From 5b338234edb5ed8d6ac4a1875730f942fe3a0ba1 Mon Sep 17 00:00:00 2001 From: "Kamshory, MT" Date: Wed, 24 Sep 2025 07:02:06 +0700 Subject: [PATCH 1/2] Update documentation --- .vscode/settings.json | 3 + docs/doc.html | 2567 ++--------------------------------------- 2 files changed, 87 insertions(+), 2483 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..6f3a2913 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/docs/doc.html b/docs/doc.html index dbae144d..863fb7b9 100644 --- a/docs/doc.html +++ b/docs/doc.html @@ -11,7 +11,7 @@
+

MagicObject\DataTable

@@ -5426,225 +5426,6 @@

Return

-
-

MagicObject\ComplexNumber\ComplexNumber

-

Declaration

-
class ComplexNumber implements Stringable -{ -}
-
-

Package

-MagicObject\Database

Authors

-
    -
  1. Kamshory
  2. -
-

Links

-
    -
  1. https://github.com/Planetbiru/MagicObject
  2. -
-

Description

-

ComplexNumber class

-
-

Properties

-
-
1. real
-

Declaration

-
private float $real;
-
-

Description

-

Real part of the complex number.

-
-
-
-
2. imaginary
-

Declaration

-
private float $imaginary;
-
-

Description

-

Imaginary part of the complex number.

-
-
-

Methods

-
-
1. __construct
-

Declaration

-
public function __construct(
-    float $real,
-    float $imaginary
-)
{
}
-
-

Description

-

Constructor to initialize the complex number.

-

Parameters

-
$real
-

Real part of the complex number.

-
$imaginary
-

Imaginary part of the complex number.

-
-
-
-
2. add
-

Declaration

-
public function add(
-    self $self
-) : self
{
}
-
-

Description

-

Add another complex number to this one.

-

Parameters

-
$self
-

The complex number to add.

-

Return

-
self
-

The sum of the two complex numbers.

-
-
-
-
3. subtract
-

Declaration

-
public function subtract(
-    self $self
-) : self
{
}
-
-

Description

-

Subtract another complex number from this one.

-

Parameters

-
$self
-

The complex number to subtract.

-

Return

-
self
-

The result of the subtraction.

-
-
-
-
4. multiply
-

Declaration

-
public function multiply(
-    self $self
-) : self
{
}
-
-

Description

-

Multiply this complex number by another.

-

Parameters

-
$self
-

The complex number to multiply.

-

Return

-
self
-

The product of the two complex numbers.

-
-
-
-
5. divide
-

Declaration

-
public function divide(
-    self $self
-) : self
{
}
-
-

Description

-

Divide this complex number by another.

-

Parameters

-
$self
-

The complex number to divide by.

-

Return

-
self
-

The result of the division.

-
-
-
-
6. magnitude
-

Declaration

-
public function magnitude() : float
{
}
-
-

Description

-

Get the magnitude of the complex number.

-

Return

-
float
-

The magnitude of the complex number.

-
-
-
-
7. conjugate
-

Declaration

-
public function conjugate() : self
{
}
-
-

Description

-

Get the conjugate of the complex number.

-

Return

-
self
-

The conjugate of the complex number.

-
-
-
-
8. __toString
-

Declaration

-
public function __toString() : string
{
}
-
-

Description

-

String representation of the complex number.

-

Return

-
string
-

The complex number as a string.

-
-
-
-
9. getReal
-

Declaration

-
public function getReal() : float
{
}
-
-

Description

-

Get the real part of the complex number.

-

Return

-
float
-

The real part.

-
-
-
-
10. setReal
-

Declaration

-
public function setReal(
-    float $real
-) : self
{
}
-
-

Description

-

Set the real part of the complex number.

-

Parameters

-
$real
-

The real part.

-

Return

-
self
-

Returns the current instance for method chaining.

-
-
-
-
11. getImaginary
-

Declaration

-
public function getImaginary() : float
{
}
-
-

Description

-

Get the imaginary part of the complex number.

-

Return

-
float
-

The imaginary part.

-
-
-
-
12. setImaginary
-

Declaration

-
public function setImaginary(
-    float $imaginary
-) : self
{
}
-
-

Description

-

Set the imaginary part of the complex number.

-

Parameters

-
$imaginary
-

The imaginary part.

-

Return

-
self
-

Returns the current instance for method chaining.

-
-
-

MagicObject\Constants\PicoHttpStatus

Declaration

@@ -18826,53 +18607,6 @@

Return

-
-

MagicObject\Exceptions\MatrixCalculationException

-

Declaration

-
class MatrixCalculationException extends Exception implements Throwable, Stringable -{ -}
-
-

Package

-MagicObject\Exceptions

Authors

-
    -
  1. Kamshory
  2. -
-

Links

-
    -
  1. https://github.com/Planetbiru/MagicObject
  2. -
-

Description

-

Class MatrixCalculationException

-

A custom exception class used specifically for errors related to matrix operations. -This can be thrown during invalid operations such as dimension mismatches, -division by zero, or unsupported matrix formats.

-

Extends the base Exception class and provides access to a previous exception for detailed debugging.

-
-

Properties

-
-
1. previous
-

Declaration

-
private Throwable $previous;
-
-

Description

-

Previous exception

-
-
-

Methods

-
-
2. getPreviousException
-

Declaration

-
public function getPreviousException() : Throwable|null
{
}
-
-

Description

-

Get the previous exception.

-

Return

-
Throwable|null
-

The previous exception

-
-
-

MagicObject\Exceptions\NoColumnMatchException

Declaration

@@ -21610,15 +21344,15 @@

Return

-
-

MagicObject\Geometry\Area

+
+

MagicObject\Language\PicoEntityLanguage

Declaration

-
class Area implements Stringable +
class PicoEntityLanguage implements Stringable { }

Package

-MagicObject\Geometry

Authors

+MagicObject\Language

Authors

  1. Kamshory
@@ -21627,58 +21361,64 @@

Links

  • https://github.com/Planetbiru/MagicObject
  • Description

    -

    Class Area

    -

    Represents a geometric area defined by various shapes such as -rectangles, triangles, polygons, and circles. This class encapsulates -properties related to the shape, its coordinates, and any associated -attributes or hyperlinks. It also provides methods to calculate -coordinates based on the shape type, apply zoom factors, and generate -an HTML representation for use in maps or similar applications.

    +

    Entity Language Class

    +

    This class manages entity language configurations, including loading +labels and handling different language options.

    -

    Properties

    +

    Constants

    +
    const ANNOTATION_TABLE = 'Table';
    const ANNOTATION_LANGUAGE = 'Language';

    Properties

    -
    1. shape
    +
    2. _currentLanguage

    Declaration

    -
    public string $shape;
    +
    private string $_currentLanguage;

    Description

    -

    Shape type of the area.

    +

    Current language code.

    -
    2. coords
    +
    3. _lableLanguage

    Declaration

    -
    public float[] $coords = array();
    +
    private PicoLanguage[] $_lableLanguage = array();

    Description

    -

    Coordinates defining the shape.

    +

    Array of PicoLanguage objects.

    -
    3. href
    +
    4. _tableIdentity

    Declaration

    -
    public string $href;
    +
    private PicoGenericObject $_tableIdentity;

    Description

    -

    Hyperlink reference associated with the area.

    +

    Table identity object.

    -
    4. attributes
    +
    5. _labels
    +

    Declaration

    +
    private array $_labels = array();
    +
    +

    Description

    +

    Labels for the entity.

    +
    +
    +
    +
    6. _entityClassName

    Declaration

    -
    public string[] $attributes;
    +
    private string $_entityClassName = '';

    Description

    -

    Additional attributes for the area.

    +

    Entity class name.

    -
    5. zoom
    +
    7. _entityLanguage

    Declaration

    -
    public float $zoom = 1;
    +
    private string $_entityLanguage = '';

    Description

    -

    Zoom factor for the area.

    +

    Entity language code.

    Methods

    @@ -21686,2081 +21426,65 @@

    Methods

    1. __construct

    Declaration

    public function __construct(
    -    mixed $object,
    -    float $zoom = 1,
    -    string|null $href = null,
    -    string[]|null $attributes = null
    +    MagicObject|null $entity = null
    )
    {
    }

    Description

    -

    Constructor for the Area class.

    +

    Constructor

    Parameters

    -
    $object
    -

    One of Rectangle, Triangle, Polygon, or Circle

    -
    $zoom
    -

    Zoom factor (default: 1)

    -
    $href
    -

    Hyperlink reference (optional)

    -
    $attributes
    -

    Additional attributes (optional)

    +
    $entity
    +

    The entity to load.

    -
    2. coordsFromRectangle
    +
    2. loadEntityLabel

    Declaration

    -
    public function coordsFromRectangle(
    -    Rectangle $object
    -) : float[]
    {
    }
    +
    public function loadEntityLabel(
    +    MagicObject $entity
    +) : self
    {
    }

    Description

    -

    Get coordinates from a rectangle.

    +

    Load data into the object from the given entity.

    Parameters

    -
    $object
    -

    Rectangle object

    +
    $entity
    +

    The entity to load.

    Return

    -
    float[]
    -

    Coordinates of the rectangle

    +
    self
    +

    Returns the current instance for method chaining.

    -
    3. coordsFromTriangle
    +
    3. addLanguage

    Declaration

    -
    public function coordsFromTriangle(
    -    Triangle $object
    -) : float[]
    {
    }
    +
    public function addLanguage(
    +    string $code,
    +    object|stdClass|array $reference,
    +    bool $use = false
    +) : self
    {
    }

    Description

    -

    Get coordinates from a triangle.

    +

    Add a language to the entity.

    Parameters

    -
    $object
    -

    Triangle object

    +
    $code
    +

    Language code.

    +
    $reference
    +

    Reference data for the language.

    +
    $use
    +

    Flag to indicate whether to use this language immediately.

    Return

    -
    float[]
    -

    Coordinates of the triangle

    +
    self
    +

    Returns the current instance for method chaining.

    -
    4. coordsFromPolygon
    +
    4. removeLanguage

    Declaration

    -
    public function coordsFromPolygon(
    -    Polygon $object
    -) : float[]
    {
    }
    +
    public function removeLanguage(
    +    string $code
    +) : self
    {
    }

    Description

    -

    Get coordinates from a polygon.

    -

    Parameters

    -
    $object
    -

    Polygon object

    -

    Return

    -
    float[]
    -

    Coordinates of the polygon

    -
    -
    -
    -
    5. coordsFromCircle
    -

    Declaration

    -
    public function coordsFromCircle(
    -    Circle $object
    -) : float[]
    {
    }
    -
    -

    Description

    -

    Get coordinates from a circle.

    -

    Parameters

    -
    $object
    -

    Circle object

    -

    Return

    -
    float[]
    -

    Coordinates of the circle

    -
    -
    -
    -
    6. getCoords
    -

    Declaration

    -
    public function getCoords(
    -    float $zoom = 1
    -) : float[]
    {
    }
    -
    -

    Description

    -

    Get coordinates with optional zoom factor.

    -

    Parameters

    -
    $zoom
    -

    Zoom factor (default: 1)

    -

    Return

    -
    float[]
    -

    Adjusted coordinates

    -
    -
    -
    -
    7. getHTML
    -

    Declaration

    -
    public function getHTML() : string
    {
    }
    -
    -

    Description

    -

    Generate HTML representation of the area.

    -

    Return

    -
    string
    -

    HTML string for the area

    -
    -
    -
    -
    8. __toString
    -

    Declaration

    -
    public function __toString() : string
    {
    }
    -
    -

    Description

    -

    Convert the area object to a string.

    -

    Return

    -
    string
    -

    HTML representation of the area

    -
    -
    -
    -
    9. getZoom
    -

    Declaration

    -
    public function getZoom() : float
    {
    }
    -
    -

    Description

    -

    Get the current zoom factor.

    -

    Return

    -
    float
    -

    Zoom factor

    -
    -
    -
    -
    10. setZoom
    -

    Declaration

    -
    public function setZoom(
    -    float $zoom
    -) : self
    {
    }
    -
    -

    Description

    -

    Set the zoom factor.

    -

    Parameters

    -
    $zoom
    -

    Zoom factor

    -

    Return

    -
    self
    -

    Returns the current instance for method chaining.

    -
    -
    -
    -
    -

    MagicObject\Geometry\Circle

    -

    Declaration

    -
    class Circle -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class Circle

    -

    Represents a circle defined by a center point and a radius. -This class provides methods to calculate the circle's circumference -and area, based on its radius. The circle is defined by its center -coordinates (x, y) and its radius (r).

    -
    -

    Properties

    -
    -
    1. center
    -

    Declaration

    -
    public Point $center;
    -
    -

    Description

    -

    Center point of the circle.

    -
    -
    -
    -
    2. x
    -

    Declaration

    -
    public float $x = 0.0;
    -
    -

    Description

    -

    x coordinate of the circle's center.

    -
    -
    -
    -
    3. y
    -

    Declaration

    -
    public float $y = 0.0;
    -
    -

    Description

    -

    y coordinate of the circle's center.

    -
    -
    -
    -
    4. r
    -

    Declaration

    -
    public float $r = 0.0;
    -
    -

    Description

    -

    Radius of the circle.

    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    float $x,
    -    float $y,
    -    float $r
    -)
    {
    }
    -
    -

    Description

    -

    Constructor to initialize the Circle with x, y, and r.

    -

    Parameters

    -
    $x
    -

    x coordinate of the center

    -
    $y
    -

    y coordinate of the center

    -
    $r
    -

    Radius of the circle

    -
    -
    -
    -
    2. getCircumference
    -

    Declaration

    -
    public function getCircumference() : float
    {
    }
    -
    -

    Description

    -

    Get the circumference of the circle.

    -

    Return

    -
    float
    -

    Circumference of the circle

    -
    -
    -
    -
    3. getArea
    -

    Declaration

    -
    public function getArea() : float
    {
    }
    -
    -

    Description

    -

    Get the area of the circle.

    -

    Return

    -
    float
    -

    Area of the circle

    -
    -
    -
    -
    -

    MagicObject\Geometry\LatBounds

    -

    Declaration

    -
    class LatBounds -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class LatBounds

    -

    Represents a latitude bounding box defined by southwestern and northeastern latitude values. -This class provides functionality to manage and calculate properties of latitude bounds, -including checking for containment, intersections, and equality with other latitude bounds.

    -
    -

    Properties

    -
    -
    1. _swLat
    -

    Declaration

    -
    protected float The southwestern latitude value. $_swLat;
    -
    -
    -
    -
    -
    2. _neLat
    -

    Declaration

    -
    protected float The northeastern latitude value. $_neLat;
    -
    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    float $swLat,
    -    float $neLat
    -)
    {
    }
    -
    -

    Description

    -

    LatBounds constructor.

    -

    Parameters

    -
    $swLat
    -

    The southwestern latitude.

    -
    $neLat
    -

    The northeastern latitude.

    -
    -
    -
    -
    2. getSw
    -

    Declaration

    -
    public function getSw() : float
    {
    }
    -
    -

    Description

    -

    Get the southwestern latitude.

    -

    Return

    -
    float
    -

    The southwestern latitude.

    -
    -
    -
    -
    3. getNe
    -

    Declaration

    -
    public function getNe() : float
    {
    }
    -
    -

    Description

    -

    Get the northeastern latitude.

    -

    Return

    -
    float
    -

    The northeastern latitude.

    -
    -
    -
    -
    4. getMidpoint
    -

    Declaration

    -
    public function getMidpoint() : float
    {
    }
    -
    -

    Description

    -

    Calculate the midpoint latitude between the southwestern and northeastern latitudes.

    -

    Return

    -
    float
    -

    The midpoint latitude.

    -
    -
    -
    -
    5. isEmpty
    -

    Declaration

    -
    public function isEmpty() : bool
    {
    }
    -
    -

    Description

    -

    Check if the latitude bounds are empty (i.e., invalid).

    -

    Return

    -
    bool
    -

    true if the bounds are empty, false otherwise.

    -
    -
    -
    -
    6. intersects
    -

    Declaration

    -
    public function intersects(
    -    LatBounds $latBounds
    -) : bool
    {
    }
    -
    -

    Description

    -

    Determine if this LatBounds intersects with another LatBounds.

    -

    Parameters

    -
    $latBounds
    -

    The other LatBounds to check for intersection.

    -

    Return

    -
    bool
    -

    true if there is an intersection, false otherwise.

    -
    -
    -
    -
    7. equals
    -

    Declaration

    -
    public function equals(
    -    LatBounds $latBounds
    -) : bool
    {
    }
    -
    -

    Description

    -

    Check if this LatBounds is equal to another LatBounds within a certain margin of error.

    -

    Parameters

    -
    $latBounds
    -

    The other LatBounds to compare.

    -

    Return

    -
    bool
    -

    true if they are equal, false otherwise.

    -
    -
    -
    -
    8. contains
    -

    Declaration

    -
    public function contains(
    -    float $lat
    -) : bool
    {
    }
    -
    -

    Description

    -

    Check if a given latitude is contained within the bounds.

    -

    Parameters

    -
    $lat
    -

    The latitude to check.

    -

    Return

    -
    bool
    -

    true if the latitude is contained, false otherwise.

    -
    -
    -
    -
    9. extend
    -

    Declaration

    -
    public function extend(
    -    float $lat
    -)
    {
    }
    -
    -

    Description

    -

    Extend the bounds to include a new latitude.

    -

    If the bounds are empty, the latitude becomes both the southwestern and northeastern bounds. -If the latitude is less than the southwestern bound, it updates the southwestern bound. -If the latitude is greater than the northeastern bound, it updates the northeastern bound.

    -

    Parameters

    -
    $lat
    -

    The latitude to extend the bounds with.

    -
    -
    -
    -
    -

    MagicObject\Geometry\LatLng

    -

    Declaration

    -
    class LatLng -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class LatLng

    -

    Represents a geographical point defined by latitude and longitude values. -This class provides methods to manage and manipulate geographic coordinates, -including equality checks and string representations.

    -
    -

    Properties

    -
    -
    1. _lat
    -

    Declaration

    -
    protected float The latitude value. $_lat;
    -
    -
    -
    -
    -
    2. _lng
    -

    Declaration

    -
    protected float The longitude value. $_lng;
    -
    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    float $lat,
    -    float $lng,
    -    bool $noWrap = false
    -)
    {
    }
    -
    -

    Description

    -

    LatLng constructor.

    -

    Parameters

    -
    $lat
    -

    The latitude value.

    -
    $lng
    -

    The longitude value.

    -
    $noWrap
    -

    Whether to wrap the longitude value.

    -

    Throws

    -
    E_USER_ERROR
    -

    If the latitude or longitude is not a valid float.

    -
    -
    -
    -
    2. getLat
    -

    Declaration

    -
    public function getLat() : float
    {
    }
    -
    -

    Description

    -

    Get the latitude value.

    -

    Return

    -
    float
    -

    The latitude.

    -
    -
    -
    -
    3. getLng
    -

    Declaration

    -
    public function getLng() : float
    {
    }
    -
    -

    Description

    -

    Get the longitude value.

    -

    Return

    -
    float
    -

    The longitude.

    -
    -
    -
    -
    4. equals
    -

    Declaration

    -
    public function equals(
    -    LatLng $latLng
    -) : bool
    {
    }
    -
    -

    Description

    -

    Check if this LatLng is equal to another LatLng object within a certain margin of error.

    -

    Parameters

    -
    $latLng
    -

    The LatLng object to compare.

    -

    Return

    -
    bool
    -

    true if they are equal, false otherwise.

    -
    -
    -
    -
    5. toString
    -

    Declaration

    -
    public function toString() : string
    {
    }
    -
    -

    Description

    -

    Convert the LatLng object to a string representation.

    -

    Return

    -
    string
    -

    The string representation of the LatLng in the format "(lat, lng)".

    -
    -
    -
    -
    6. toUrlValue
    -

    Declaration

    -
    public function toUrlValue(
    -    int $precision = 6
    -) : string
    {
    }
    -
    -

    Description

    -

    Convert the LatLng object to a URL-friendly string value.

    -

    Parameters

    -
    $precision
    -

    The number of decimal places to round to (default: 6).

    -

    Return

    -
    string
    -

    The latitude and longitude values as a string.

    -
    -
    -
    -
    -

    MagicObject\Geometry\LatLngBounds

    -

    Declaration

    -
    class LatLngBounds -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class LatLngBounds

    -

    Represents a bounding box defined by southwest and northeast LatLng objects.

    -
    -

    Properties

    -
    -
    1. _latBounds
    -

    Declaration

    -
    protected LatBounds The latitude bounds of the bounding box. $_latBounds;
    -
    -
    -
    -
    -
    2. _lngBounds
    -

    Declaration

    -
    protected LngBounds The longitude bounds of the bounding box. $_lngBounds;
    -
    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    LatLng|null $latLngSw = null,
    -    LatLng|null $tatLngNe = null
    -)
    {
    }
    -
    -

    Description

    -

    LatLngBounds constructor.

    -

    Parameters

    -
    $latLngSw
    -

    The southwestern LatLng object.

    -
    $tatLngNe
    -

    The northeastern LatLng object.

    -

    Throws

    -
    E_USER_ERROR
    -

    If the provided LatLng objects are invalid.

    -
    -
    -
    -
    2. getLatBounds
    -

    Declaration

    -
    public function getLatBounds() : LatBounds
    {
    }
    -
    -

    Description

    -

    Get the latitude bounds.

    -

    Return

    -
    LatBounds
    -

    The latitude bounds of the bounding box.

    -
    -
    -
    -
    3. getLngBounds
    -

    Declaration

    -
    public function getLngBounds() : LngBounds
    {
    }
    -
    -

    Description

    -

    Get the longitude bounds.

    -

    Return

    -
    LngBounds
    -

    The longitude bounds of the bounding box.

    -
    -
    -
    -
    4. getCenter
    -

    Declaration

    -
    public function getCenter() : LatLng
    {
    }
    -
    -

    Description

    -

    Get the center point of the bounding box.

    -

    Return

    -
    LatLng
    -

    The center point as a LatLng object.

    -
    -
    -
    -
    5. isEmpty
    -

    Declaration

    -
    public function isEmpty() : bool
    {
    }
    -
    -

    Description

    -

    Check if the bounding box is empty.

    -

    Return

    -
    bool
    -

    true if the bounding box is empty, false otherwise.

    -
    -
    -
    -
    6. getSouthWest
    -

    Declaration

    -
    public function getSouthWest() : LatLng
    {
    }
    -
    -

    Description

    -

    Get the southwestern corner of the bounding box.

    -

    Return

    -
    LatLng
    -

    The southwestern corner as a LatLng object.

    -
    -
    -
    -
    7. getNorthEast
    -

    Declaration

    -
    public function getNorthEast() : LatLng
    {
    }
    -
    -

    Description

    -

    Get the northeastern corner of the bounding box.

    -

    Return

    -
    LatLng
    -

    The northeastern corner as a LatLng object.

    -
    -
    -
    -
    8. toSpan
    -

    Declaration

    -
    public function toSpan() : LatLng
    {
    }
    -
    -

    Description

    -

    Get the span of the bounding box as a LatLng object.

    -

    Return

    -
    LatLng
    -

    The span defined by the latitude and longitude differences.

    -
    -
    -
    -
    9. toString
    -

    Declaration

    -
    public function toString() : string
    {
    }
    -
    -

    Description

    -

    Convert the bounding box to a string representation.

    -

    Return

    -
    string
    -

    The string representation of the bounding box.

    -
    -
    -
    -
    10. toUrlValue
    -

    Declaration

    -
    public function toUrlValue(
    -    int $precision = 6
    -) : string
    {
    }
    -
    -

    Description

    -

    Convert the bounding box to a URL-friendly string value.

    -

    Parameters

    -
    $precision
    -

    The number of decimal places to round to.

    -

    Return

    -
    string
    -

    The southwest and northeast corner values as a string.

    -
    -
    -
    -
    11. equals
    -

    Declaration

    -
    public function equals(
    -    LatLngBounds $latLngBounds
    -) : bool
    {
    }
    -
    -

    Description

    -

    Check if this LatLngBounds is equal to another LatLngBounds object.

    -

    Parameters

    -
    $latLngBounds
    -

    The LatLngBounds object to compare.

    -

    Return

    -
    bool
    -

    true if they are equal, false otherwise.

    -
    -
    -
    -
    12. intersects
    -

    Declaration

    -
    public function intersects(
    -    LatLngBounds $latLngBounds
    -) : bool
    {
    }
    -
    -

    Description

    -

    Check if this LatLngBounds intersects with another LatLngBounds.

    -

    Parameters

    -
    $latLngBounds
    -

    The LatLngBounds to check for intersection.

    -

    Return

    -
    bool
    -

    true if they intersect, false otherwise.

    -
    -
    -
    -
    13. union
    -

    Declaration

    -
    public function union(
    -    LatLngBounds $latLngBounds
    -) : $this
    {
    }
    -
    -

    Description

    -

    Extend this bounding box to include another LatLngBounds.

    -

    Parameters

    -
    $latLngBounds
    -

    The LatLngBounds to extend with.

    -

    Return

    -
    $this
    -

    The current instance for method chaining.

    -
    -
    -
    -
    14. contains
    -

    Declaration

    -
    public function contains(
    -    LatLng $latLng
    -) : bool
    {
    }
    -
    -

    Description

    -

    Check if this LatLngBounds contains a specific LatLng point.

    -

    Parameters

    -
    $latLng
    -

    The LatLng point to check for containment.

    -

    Return

    -
    bool
    -

    true if the point is contained, false otherwise.

    -
    -
    -
    -
    15. extend
    -

    Declaration

    -
    public function extend(
    -    LatLng $latLng
    -) : $this
    {
    }
    -
    -

    Description

    -

    Extend the bounding box to include a new LatLng point.

    -

    Parameters

    -
    $latLng
    -

    The LatLng point to extend with.

    -

    Return

    -
    $this
    -

    The current instance for method chaining.

    -
    -
    -
    -
    -

    MagicObject\Geometry\Line

    -

    Declaration

    -
    class Line -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class representing a Line with two Point objects.

    -

    This class defines a Line in a 2D space represented by two endpoints, Point A and Point B. -It provides methods to calculate the length of the line and ensure the endpoints are valid Point instances.

    -
    -

    Properties

    -
    -
    1. a
    -

    Declaration

    -
    public Point $a;
    -
    -

    Description

    -

    Point A.

    -
    -
    -
    -
    2. b
    -

    Declaration

    -
    public Point $b;
    -
    -

    Description

    -

    Point B.

    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    Point $a,
    -    Point $b
    -)
    {
    }
    -
    -

    Description

    -

    Constructor to initialize the Line with two Point objects.

    -

    Parameters

    -
    $a
    -

    Point A.

    -
    $b
    -

    Point B.

    -

    Throws

    -
    InvalidArgumentException
    -

    If the parameters are not instances of Point.

    -
    -
    -
    -
    2. getLength
    -

    Declaration

    -
    public function getLength() : float
    {
    }
    -
    -

    Description

    -

    Method to calculate the length of the line.

    -

    This method calculates the Euclidean distance between Point A and Point B.

    -

    Return

    -
    float
    -

    The length of the line between Point A and Point B.

    -
    -
    -
    -
    -

    MagicObject\Geometry\LngBounds

    -

    Declaration

    -
    class LngBounds -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class LngBounds

    -

    Represents a longitudinal bounding range defined by southwest and northeast longitude values.

    -
    -

    Properties

    -
    -
    1. _swLng
    -

    Declaration

    -
    protected float The southwestern longitude value. $_swLng;
    -
    -
    -
    -
    -
    2. _neLng
    -

    Declaration

    -
    protected float The northeastern longitude value. $_neLng;
    -
    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    float $swLng,
    -    float $neLng
    -)
    {
    }
    -
    -

    Description

    -

    LngBounds constructor.

    -

    Parameters

    -
    $swLng
    -

    The southwestern longitude value.

    -
    $neLng
    -

    The northeastern longitude value.

    -
    -
    -
    -
    2. getSw
    -

    Declaration

    -
    public function getSw() : float
    {
    }
    -
    -

    Description

    -

    Get the southwestern longitude.

    -

    Return

    -
    float
    -

    The southwestern longitude value.

    -
    -
    -
    -
    3. getNe
    -

    Declaration

    -
    public function getNe() : float
    {
    }
    -
    -

    Description

    -

    Get the northeastern longitude.

    -

    Return

    -
    float
    -

    The northeastern longitude value.

    -
    -
    -
    -
    4. getMidpoint
    -

    Declaration

    -
    public function getMidpoint() : float
    {
    }
    -
    -

    Description

    -

    Get the midpoint of the longitude bounds.

    -

    Return

    -
    float
    -

    The midpoint longitude value.

    -
    -
    -
    -
    5. isEmpty
    -

    Declaration

    -
    public function isEmpty() : bool
    {
    }
    -
    -

    Description

    -

    Check if the bounds are empty.

    -

    Return

    -
    bool
    -

    true if the bounds are empty, false otherwise.

    -
    -
    -
    -
    6. intersects
    -

    Declaration

    -
    public function intersects(
    -    LngBounds $lngBounds
    -) : bool
    {
    }
    -
    -

    Description

    -

    Check if this LngBounds intersects with another LngBounds.

    -

    Parameters

    -
    $lngBounds
    -

    The LngBounds to check for intersection.

    -

    Return

    -
    bool
    -

    true if they intersect, false otherwise.

    -
    -
    -
    -
    7. equals
    -

    Declaration

    -
    public function equals(
    -    LngBounds $lngBounds
    -) : bool
    {
    }
    -
    -

    Description

    -

    Check if this LngBounds is equal to another LngBounds.

    -

    Parameters

    -
    $lngBounds
    -

    The LngBounds object to compare.

    -

    Return

    -
    bool
    -

    true if they are equal, false otherwise.

    -
    -
    -
    -
    8. contains
    -

    Declaration

    -
    public function contains(
    -    float $lng
    -) : bool
    {
    }
    -
    -

    Description

    -

    Check if a given longitude is contained within the bounds.

    -

    Parameters

    -
    $lng
    -

    The longitude to check.

    -

    Return

    -
    bool
    -

    true if the longitude is contained, false otherwise.

    -
    -
    -
    -
    9. extend
    -

    Declaration

    -
    public function extend(
    -    float $lng
    -) : void
    {
    }
    -
    -

    Description

    -

    Extend the bounds to include a new longitude.

    -

    Parameters

    -
    $lng
    -

    The longitude to extend the bounds with.

    -

    Return

    -
    void
    -
    -
    -
    -
    -
    -

    MagicObject\Geometry\Map

    -

    Declaration

    -
    class Map -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class representing a Map containing multiple Areas.

    -

    This class manages a collection of Area objects, allowing for the addition and retrieval of areas. -It can be initialized with an optional array of Area objects.

    -
    -

    Properties

    -
    -
    1. areas
    -

    Declaration

    -
    private Area[] $areas = array();
    -
    -

    Description

    -

    Areas in the map.

    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    Area[]|null $areas = null
    -)
    {
    }
    -
    -

    Description

    -

    Constructor to initialize the Map with optional areas.

    -

    Parameters

    -
    $areas
    -

    An array of Area objects to initialize the map with.

    -
    -
    -
    -
    2. addArea
    -

    Declaration

    -
    public function addArea(
    -    Area $area
    -) : self
    {
    }
    -
    -

    Description

    -

    Add an area to the map.

    -

    This method appends a new Area object to the map's collection of areas.

    -

    Parameters

    -
    $area
    -

    Area to add

    -

    Return

    -
    self
    -

    Returns the current instance for method chaining.

    -
    -
    -
    -
    3. getAreas
    -

    Declaration

    -
    public function getAreas() : Area[]
    {
    }
    -
    -

    Description

    -

    Get all areas in the map.

    -

    This method returns an array of Area objects contained in the map.

    -

    Return

    -
    Area[]
    -

    An array of Area objects

    -
    -
    -
    -
    -

    MagicObject\Geometry\NodeAttribute

    -

    Declaration

    -
    class NodeAttribute implements Stringable -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class representing node attributes.

    -

    This class stores a collection of attribute values associated with a node. -It provides methods for initialization and converting the attributes to a string representation, -suitable for use in contexts such as HTML attributes.

    -
    -

    Properties

    -
    -
    1. values
    -

    Declaration

    -
    private string[] $values = array();
    -
    -

    Description

    -

    Values of the node attributes.

    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    string[] $values
    -)
    {
    }
    -
    -

    Description

    -

    Constructor to initialize the NodeAttribute with values.

    -

    Parameters

    -
    $values
    -

    An array of attribute values.

    -
    -
    -
    -
    2. __toString
    -

    Declaration

    -
    public function __toString() : string
    {
    }
    -
    -

    Description

    -

    Convert the node attributes to a string representation.

    -

    This method returns the attributes in a format suitable for inclusion in HTML tags, -where each attribute is represented as key="value".

    -

    Return

    -
    string
    -

    A string representation of the node attributes.

    -
    -
    -
    -
    -

    MagicObject\Geometry\Point

    -

    Declaration

    -
    class Point -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class representing a Point with x and y coordinates.

    -

    This class defines a Point in a 2D Cartesian coordinate system, -allowing for the representation of its position and the calculation of distances to other Points.

    -
    -

    Properties

    -
    -
    1. x
    -

    Declaration

    -
    public float $x = 0.0;
    -
    -

    Description

    -

    X coordinate.

    -
    -
    -
    -
    2. y
    -

    Declaration

    -
    public float $y = 0.0;
    -
    -

    Description

    -

    Y coordinate.

    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    float $x,
    -    float $y
    -)
    {
    }
    -
    -

    Description

    -

    Constructor to initialize the Point with x and y coordinates.

    -

    Parameters

    -
    $x
    -

    X coordinate.

    -
    $y
    -

    Y coordinate.

    -
    -
    -
    -
    2. distanceFrom
    -

    Declaration

    -
    public function distanceFrom(
    -    Point $p
    -) : float
    {
    }
    -
    -

    Description

    -

    Calculate the distance between this Point and another Point.

    -

    This method computes the Euclidean distance between the current Point -and another Point provided as an argument.

    -

    Parameters

    -
    $p
    -

    Another Point.

    -

    Return

    -
    float
    -

    The distance between the two Points.

    -

    Throws

    -
    InvalidArgumentException
    -

    If the argument is not of type Point.

    -
    -
    -
    -
    3. distanceTo
    -

    Declaration

    -
    public function distanceTo(
    -    Point $p
    -) : float
    {
    }
    -
    -

    Description

    -

    Calculate the distance between this Point and another Point.

    -

    This method serves as an alias to distanceFrom for better readability.

    -

    Parameters

    -
    $p
    -

    Another Point.

    -

    Return

    -
    float
    -

    The distance between the two Points.

    -
    -
    -
    -
    -

    MagicObject\Geometry\Polygon

    -

    Declaration

    -
    class Polygon -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class representing a polygon defined by a series of points.

    -

    This class allows for the creation and manipulation of polygons, including -adding points, clearing the polygon, and calculating its area and circumference.

    -
    -

    Properties

    -
    -
    1. points
    -

    Declaration

    -
    private Point[] $points = array();
    -
    -

    Description

    -

    Points that make up the polygon.

    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    Point[] $points = array ( -)
    -)
    {
    }
    -
    -

    Description

    -

    Constructor to initialize the Polygon with an array of Points.

    -

    Parameters

    -
    $points
    -

    Initial points for the polygon.

    -
    -
    -
    -
    2. addPoint
    -

    Declaration

    -
    public function addPoint(
    -    Point $point
    -) : self
    {
    }
    -
    -

    Description

    -

    Add a point to the polygon.

    -

    Parameters

    -
    $point
    -

    Point to add.

    -

    Return

    -
    self
    -

    Returns the current instance for method chaining.

    -
    -
    -
    -
    3. clearPolygon
    -

    Declaration

    -
    public function clearPolygon() : self
    {
    }
    -
    -

    Description

    -

    Clear all points from the polygon.

    -

    This method removes all points currently defined for the polygon.

    -

    Return

    -
    self
    -

    Returns the current instance for method chaining.

    -
    -
    -
    -
    4. getArea
    -

    Declaration

    -
    public function getArea() : float
    {
    }
    -
    -

    Description

    -

    Calculate the area of the polygon using the Shoelace formula.

    -

    Return

    -
    float
    -

    The area of the polygon.

    -

    Throws

    -
    InvalidPolygonException
    -

    If the polygon has fewer than 3 points.

    -
    -
    -
    -
    5. getCircumference
    -

    Declaration

    -
    public function getCircumference() : float
    {
    }
    -
    -

    Description

    -

    Calculate the circumference of the polygon.

    -

    This method computes the total length of the polygon's edges.

    -

    Return

    -
    float
    -

    The circumference of the polygon.

    -

    Throws

    -
    InvalidPolygonException
    -

    If the polygon has fewer than 2 points.

    -
    -
    -
    -
    6. getPoints
    -

    Declaration

    -
    public function getPoints() : Point[]
    {
    }
    -
    -

    Description

    -

    Get the points of the polygon.

    -

    Return

    -
    Point[]
    -

    An array of Point objects that define the polygon.

    -
    -
    -
    -
    -

    MagicObject\Geometry\Rectangle

    -

    Declaration

    -
    class Rectangle -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class representing a rectangle defined by two Point objects.

    -

    This class represents a rectangle using its bottom-left and top-right corner points. -It provides methods to calculate the area and circumference (perimeter) of the rectangle -by utilizing a Polygon representation of the rectangle's corners.

    -
    -

    Properties

    -
    -
    1. a
    -

    Declaration

    -
    public Point $a;
    -
    -

    Description

    -

    Bottom-left corner point of the rectangle.

    -
    -
    -
    -
    2. b
    -

    Declaration

    -
    public Point $b;
    -
    -

    Description

    -

    Top-right corner point of the rectangle.

    -
    -
    -
    -
    3. polygon
    -

    Declaration

    -
    public Polygon $polygon;
    -
    -

    Description

    -

    Polygon representation of the rectangle.

    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    Point $a,
    -    Point $b
    -)
    {
    }
    -
    -

    Description

    -

    Constructor to initialize the Rectangle with two Point objects.

    -

    Parameters

    -
    $a
    -

    Bottom-left corner point.

    -
    $b
    -

    Top-right corner point.

    -
    -
    -
    -
    2. getArea
    -

    Declaration

    -
    public function getArea() : float
    {
    }
    -
    -

    Description

    -

    Calculate the area of the rectangle.

    -

    Return

    -
    float
    -

    The area of the rectangle.

    -

    Throws

    -
    InvalidPolygonException
    -

    If the polygon is invalid.

    -
    -
    -
    -
    3. getCircumference
    -

    Declaration

    -
    public function getCircumference() : float
    {
    }
    -
    -

    Description

    -

    Get the circumference (perimeter) of the rectangle.

    -

    Return

    -
    float
    -

    The circumference of the rectangle.

    -

    Throws

    -
    InvalidPolygonException
    -

    If the polygon is invalid.

    -
    -
    -
    -
    -

    MagicObject\Geometry\SphericalGeometry

    -

    Declaration

    -
    class SphericalGeometry -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Static class SphericalGeometry

    -

    Provides utility functions for computing geodesic angles, distances, areas, and other spherical geometry calculations.

    -
    -

    Constants

    -
    const EQUALS_MARGIN_ERROR = 1.0E-9;
    const EARTH_RADIUS = 6378137;

    Methods

    -
    -
    1. getEarthRadius
    -

    Declaration

    -
    public static function getEarthRadius() : float
    {
    }
    -
    -

    Description

    -

    Get the Earth's radius.

    -

    Return

    -
    float
    -

    The Earth's radius in meters.

    -
    -
    -
    -
    2. computeBounds
    -

    Declaration

    -
    public static function computeBounds(
    -    LatLng $latLng,
    -    int|float $radius
    -) : LatLngBounds
    {
    }
    -
    -

    Description

    -

    Computes a bounding rectangle (LatLngBounds instance) from a point and a given radius.

    -

    Reference: http://www.movable-type.co.uk/scripts/latlong-db.html

    -

    Parameters

    -
    $latLng
    -

    The center point as a LatLng object.

    -
    $radius
    -

    The radius in meters.

    -

    Return

    -
    LatLngBounds
    -

    The computed bounding rectangle.

    -
    -
    -
    -
    3. computeHeading
    -

    Declaration

    -
    public static function computeHeading(
    -    LatLng $fromLatLng,
    -    LatLng $toLatLng
    -) : float
    {
    }
    -
    -

    Description

    -

    Computes the heading from one LatLng to another.

    -

    Parameters

    -
    $fromLatLng
    -

    The starting LatLng.

    -
    $toLatLng
    -

    The destination LatLng.

    -

    Return

    -
    float
    -

    The heading in degrees from the starting point to the destination.

    -
    -
    -
    -
    4. computeOffset
    -

    Declaration

    -
    public static function computeOffset(
    -    LatLng $fromLatLng,
    -    float $distance,
    -    float $heading
    -) : LatLng
    {
    }
    -
    -

    Description

    -

    Computes a new LatLng based on a starting point, distance, and heading.

    -

    Parameters

    -
    $fromLatLng
    -

    The starting LatLng.

    -
    $distance
    -

    The distance to move, in meters.

    -
    $heading
    -

    The direction to move, in degrees.

    -

    Return

    -
    LatLng
    -

    The new LatLng after the offset.

    -
    -
    -
    -
    5. containsLocation
    -

    Declaration

    -
    public static function containsLocation(
    -    object $point,
    -    object $polygon
    -) : bool
    {
    }
    -
    -

    Description

    -

    Determines whether a point is contained within a polygon.

    -

    Parameters

    -
    $point
    -

    A point object with x() and y() methods for longitude and latitude.

    -
    $polygon
    -

    A polygon object with an exteriorRing() method.

    -

    Return

    -
    bool
    -

    true if the point is inside the polygon, false otherwise.

    -
    -
    -
    -
    6. interpolate
    -

    Declaration

    -
    public static function interpolate(
    -    LatLng $fromLatLng,
    -    LatLng $toLatLng,
    -    float $fraction
    -) : LatLng
    {
    }
    -
    -

    Description

    -

    Interpolates between two LatLng points based on a fraction.

    -

    Parameters

    -
    $fromLatLng
    -

    The starting LatLng.

    -
    $toLatLng
    -

    The ending LatLng.

    -
    $fraction
    -

    A fraction between 0 and 1.

    -

    Return

    -
    LatLng
    -

    The interpolated LatLng.

    -
    -
    -
    -
    7. computeDistanceBetween
    -

    Declaration

    -
    public static function computeDistanceBetween(
    -    LatLng $latLng1,
    -    LatLng $latLng2
    -) : float
    {
    }
    -
    -

    Description

    -

    Computes the distance between two LatLng points.

    -

    Parameters

    -
    $latLng1
    -

    The first LatLng point.

    -
    $latLng2
    -

    The second LatLng point.

    -

    Return

    -
    float
    -

    The distance in yards.

    -
    -
    -
    -
    8. computeLength
    -

    Declaration

    -
    public static function computeLength(
    -    LatLng[] $latLngsArray
    -) : float
    {
    }
    -
    -

    Description

    -

    Computes the total length of a series of LatLng points.

    -

    Parameters

    -
    $latLngsArray
    -

    An array of LatLng points.

    -

    Return

    -
    float
    -

    The total length in yards.

    -
    -
    -
    -
    9. computeArea
    -

    Declaration

    -
    public static function computeArea(
    -    LatLng[] $latLngsArray
    -) : float
    {
    }
    -
    -

    Description

    -

    Computes the area of a polygon defined by a series of LatLng points.

    -

    Parameters

    -
    $latLngsArray
    -

    An array of LatLng points defining the polygon.

    -

    Return

    -
    float
    -

    The area in square meters.

    -
    -
    -
    -
    10. computeSignedArea
    -

    Declaration

    -
    public static function computeSignedArea(
    -    LatLng[] $latLngsArray,
    -    bool $signed = true
    -) : float
    {
    }
    -
    -

    Description

    -

    Computes the signed area of a polygon defined by a series of LatLng points.

    -

    Parameters

    -
    $latLngsArray
    -

    An array of LatLng points defining the polygon.

    -
    $signed
    -

    Whether to return a signed area.

    -

    Return

    -
    float
    -

    The signed area in square meters.

    -
    -
    -
    -
    11. clampLatitude
    -

    Declaration

    -
    public static function clampLatitude(
    -    float $lat
    -) : float
    {
    }
    -
    -

    Description

    -

    Clamps a latitude value to be within valid bounds.

    -

    Parameters

    -
    $lat
    -

    The latitude to clamp.

    -

    Return

    -
    float
    -

    The clamped latitude value.

    -
    -
    -
    -
    12. wrapLongitude
    -

    Declaration

    -
    public static function wrapLongitude(
    -    float $lng
    -) : float
    {
    }
    -
    -

    Description

    -

    Wraps a longitude value to be within valid bounds.

    -

    Parameters

    -
    $lng
    -

    The longitude to wrap.

    -

    Return

    -
    float
    -

    The wrapped longitude value.

    -
    -
    -
    -
    13. _computeDistanceInRadiansBetween
    -

    Declaration

    -
    protected static function _computeDistanceInRadiansBetween(
    -    LatLng $latLng1,
    -    LatLng $latLng2
    -) : float
    {
    }
    -
    -

    Description

    -

    Computes the great circle distance (in radians) between two points. -Uses the Haversine formula.

    -

    Parameters

    -
    $latLng1
    -

    The first LatLng point.

    -
    $latLng2
    -

    The second LatLng point.

    -

    Return

    -
    float
    -

    The distance in radians.

    -
    -
    -
    -
    14. _computeSphericalExcess
    -

    Declaration

    -
    protected static function _computeSphericalExcess(
    -    LatLng $latLng1,
    -    LatLng $latLng2,
    -    LatLng $latLng3,
    -    bool $signed
    -) : float
    {
    }
    -
    -

    Description

    -

    Computes the spherical excess using L'Huilier's Theorem.

    -

    Parameters

    -
    $latLng1
    -

    The first vertex of the triangle.

    -
    $latLng2
    -

    The second vertex of the triangle.

    -
    $latLng3
    -

    The third vertex of the triangle.

    -
    $signed
    -

    Whether to return a signed value.

    -

    Return

    -
    float
    -

    The spherical excess.

    -
    -
    -
    -
    -

    MagicObject\Geometry\Triangle

    -

    Declaration

    -
    class Triangle -{ -}
    -
    -

    Package

    -MagicObject\Geometry

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class representing a triangle defined by three Point objects.

    -

    This class represents a triangle in a 2D space using three vertices. -It provides methods to calculate the lengths of the sides and the area using Heron's formula.

    -
    -

    Properties

    -
    -
    1. a
    -

    Declaration

    -
    public Point $a;
    -
    -

    Description

    -

    Vertex A of the triangle.

    -
    -
    -
    -
    2. b
    -

    Declaration

    -
    public Point $b;
    -
    -

    Description

    -

    Vertex B of the triangle.

    -
    -
    -
    -
    3. c
    -

    Declaration

    -
    public Point $c;
    -
    -

    Description

    -

    Vertex C of the triangle.

    -
    -
    -
    -
    4. sa
    -

    Declaration

    -
    public float $sa;
    -
    -

    Description

    -

    Length of side opposite to vertex A.

    -
    -
    -
    -
    5. sb
    -

    Declaration

    -
    public float $sb;
    -
    -

    Description

    -

    Length of side opposite to vertex B.

    -
    -
    -
    -
    6. sc
    -

    Declaration

    -
    public float $sc;
    -
    -

    Description

    -

    Length of side opposite to vertex C.

    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    Point $a,
    -    Point $b,
    -    Point $c
    -)
    {
    }
    -
    -

    Description

    -

    Constructor to initialize the Triangle with three Point objects.

    -

    Parameters

    -
    $a
    -

    The first vertex of the triangle.

    -
    $b
    -

    The second vertex of the triangle.

    -
    $c
    -

    The third vertex of the triangle.

    -
    -
    -
    -
    2. getArea
    -

    Declaration

    -
    public function getArea() : float
    {
    }
    -
    -

    Description

    -

    Calculate the area of the triangle using Heron's formula.

    -

    Return

    -
    float
    -

    The area of the triangle.

    -
    -
    -
    -
    -

    MagicObject\Language\PicoEntityLanguage

    -

    Declaration

    -
    class PicoEntityLanguage implements Stringable -{ -}
    -
    -

    Package

    -MagicObject\Language

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Entity Language Class

    -

    This class manages entity language configurations, including loading -labels and handling different language options.

    -
    -

    Constants

    -
    const ANNOTATION_TABLE = 'Table';
    const ANNOTATION_LANGUAGE = 'Language';

    Properties

    -
    -
    2. _currentLanguage
    -

    Declaration

    -
    private string $_currentLanguage;
    -
    -

    Description

    -

    Current language code.

    -
    -
    -
    -
    3. _lableLanguage
    -

    Declaration

    -
    private PicoLanguage[] $_lableLanguage = array();
    -
    -

    Description

    -

    Array of PicoLanguage objects.

    -
    -
    -
    -
    4. _tableIdentity
    -

    Declaration

    -
    private PicoGenericObject $_tableIdentity;
    -
    -

    Description

    -

    Table identity object.

    -
    -
    -
    -
    5. _labels
    -

    Declaration

    -
    private array $_labels = array();
    -
    -

    Description

    -

    Labels for the entity.

    -
    -
    -
    -
    6. _entityClassName
    -

    Declaration

    -
    private string $_entityClassName = '';
    -
    -

    Description

    -

    Entity class name.

    -
    -
    -
    -
    7. _entityLanguage
    -

    Declaration

    -
    private string $_entityLanguage = '';
    -
    -

    Description

    -

    Entity language code.

    -
    -
    -

    Methods

    -
    -
    1. __construct
    -

    Declaration

    -
    public function __construct(
    -    MagicObject|null $entity = null
    -)
    {
    }
    -
    -

    Description

    -

    Constructor

    -

    Parameters

    -
    $entity
    -

    The entity to load.

    -
    -
    -
    -
    2. loadEntityLabel
    -

    Declaration

    -
    public function loadEntityLabel(
    -    MagicObject $entity
    -) : self
    {
    }
    -
    -

    Description

    -

    Load data into the object from the given entity.

    -

    Parameters

    -
    $entity
    -

    The entity to load.

    -

    Return

    -
    self
    -

    Returns the current instance for method chaining.

    -
    -
    -
    -
    3. addLanguage
    -

    Declaration

    -
    public function addLanguage(
    -    string $code,
    -    object|stdClass|array $reference,
    -    bool $use = false
    -) : self
    {
    }
    -
    -

    Description

    -

    Add a language to the entity.

    -

    Parameters

    -
    $code
    -

    Language code.

    -
    $reference
    -

    Reference data for the language.

    -
    $use
    -

    Flag to indicate whether to use this language immediately.

    -

    Return

    -
    self
    -

    Returns the current instance for method chaining.

    -
    -
    -
    -
    4. removeLanguage
    -

    Declaration

    -
    public function removeLanguage(
    -    string $code
    -) : self
    {
    }
    -
    -

    Description

    -

    Remove a language from the entity.

    +

    Remove a language from the entity.

    Parameters

    $code

    Language code to remove.

    @@ -24305,142 +22029,6 @@

    Return

    -
    -

    MagicObject\Matrix\Matrix

    -

    Declaration

    -
    class Matrix -{ -}
    -
    -

    Package

    -MagicObject\Database

    Authors

    -
      -
    1. Kamshory
    2. -
    -

    Links

    -
      -
    1. https://github.com/Planetbiru/MagicObject
    2. -
    -

    Description

    -

    Class Matrix

    -

    Provides basic operations for 2D matrices with real number elements, -including addition, subtraction, multiplication, and element-wise division.

    -

    All matrices must be well-formed (i.e., rectangular and of compatible sizes for the operation).

    -
    -

    Methods

    -
    -
    1. add
    -

    Declaration

    -
    public function add(
    -    array $a,
    -    array $b
    -) : array
    {
    }
    -
    -

    Description

    -

    Adds two matrices element-wise.

    -

    Parameters

    -
    $a
    -

    First matrix.

    -
    $b
    -

    Second matrix.

    -

    Return

    -
    array
    -

    Resulting matrix after addition.

    -

    Throws

    -
    MatrixCalculationException
    -

    If matrix dimensions do not match.

    -
    -
    -
    -
    2. subtract
    -

    Declaration

    -
    public function subtract(
    -    array $a,
    -    array $b
    -) : array
    {
    }
    -
    -

    Description

    -

    Subtracts matrix B from matrix A element-wise.

    -

    Parameters

    -
    $a
    -

    First matrix.

    -
    $b
    -

    Second matrix.

    -

    Return

    -
    array
    -

    Resulting matrix after subtraction.

    -

    Throws

    -
    MatrixCalculationException
    -

    If matrix dimensions do not match.

    -
    -
    -
    -
    3. multiply
    -

    Declaration

    -
    public function multiply(
    -    array $a,
    -    array $b
    -) : array
    {
    }
    -
    -

    Description

    -

    Multiplies two matrices using standard matrix multiplication.

    -

    Parameters

    -
    $a
    -

    First matrix.

    -
    $b
    -

    Second matrix.

    -

    Return

    -
    array
    -

    Resulting matrix after multiplication.

    -

    Throws

    -
    MatrixCalculationException
    -

    If matrix dimensions are not compatible for multiplication.

    -
    -
    -
    -
    4. divide
    -

    Declaration

    -
    public function divide(
    -    array $a,
    -    array $b
    -) : array
    {
    }
    -
    -

    Description

    -

    Divides matrix A by matrix B element-wise.

    -

    Parameters

    -
    $a
    -

    First matrix.

    -
    $b
    -

    Second matrix.

    -

    Return

    -
    array
    -

    Resulting matrix after element-wise division.

    -

    Throws

    -
    MatrixCalculationException
    -

    If dimensions do not match or division by zero occurs.

    -
    -
    -
    -
    5. validateSameDimensions
    -

    Declaration

    -
    private function validateSameDimensions(
    -    array $a,
    -    array $b
    -)
    {
    }
    -
    -

    Description

    -

    Validates that two matrices have the same dimensions.

    -

    Parameters

    -
    $a
    -

    First matrix.

    -
    $b
    -

    Second matrix.

    -

    Throws

    -
    MatrixCalculationException
    -

    If dimensions do not match.

    -
    -
    -

    MagicObject\Pagination\PicoPagination

    Declaration

    @@ -26920,7 +24508,7 @@

    Declaration

    public function startSession() : bool
    {
    }

    Description

    -

    (Re)starts the session.

    +

    (Re)starts the session and update cookie.

    This method starts a session if it hasn't been started already.

    Return

    bool
    @@ -27146,9 +24734,9 @@

    Return

    -
    15. setSessionMaxLifeTime
    +
    15. setSessionMaxLifetime

    Declaration

    -
    public function setSessionMaxLifeTime(
    +
    public function setSessionMaxLifetime(
        int $lifeTime
    ) : self
    {
    }
    @@ -27257,7 +24845,20 @@

    Return

    -
    21. __toString
    +
    21. refreshSessionCookie
    +

    Declaration

    +
    public function refreshSessionCookie() : void
    {
    }
    +
    +

    Description

    +

    Refreshes the session cookie to extend its lifetime.

    +

    Call this to implement sliding expiration (extend session expiry each request).

    +

    Return

    +
    void
    +
    +
    +
    +
    +
    22. __toString

    Declaration

    public function __toString() : string
    {
    }
    From 80b4e46de579f15133b00f738ed814655e194878 Mon Sep 17 00:00:00 2001 From: "Kamshory, MT" Date: Wed, 24 Sep 2025 07:05:08 +0700 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8bb2822..3377e3a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1391,3 +1391,25 @@ This provides a **persistent session storage** mechanism using **SQLite** as the * **Lightweight:** Suitable for shared hosting or small applications. * **Reliability:** Prevents session loss when PHP restarts, unlike file-based sessions. +# MagicObject Version 3.20.0 + +## Change: Removal of Math-Related Classes + +In this release, several math-related classes have been **removed** from MagicObject to keep the core library lightweight and focused. + +### Removed Modules + +1. Complex Numbers +2. Matrix Operations +3. Geometry Utilities + +### Migration + +These classes are **not discontinued**, but have been moved into a **new dedicated repository**: + +👉 [Planetbiru/Math](https://github.com/Planetbiru/Math) + +Developers who rely on these math utilities should install the new package separately: + +```bash +composer require planetbiru/math