1
This commit is contained in:
7
vendor/phpoffice/math/src/Math/Element/AbstractElement.php
vendored
Normal file
7
vendor/phpoffice/math/src/Math/Element/AbstractElement.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\Math\Element;
|
||||
|
||||
abstract class AbstractElement
|
||||
{
|
||||
}
|
||||
35
vendor/phpoffice/math/src/Math/Element/AbstractGroupElement.php
vendored
Normal file
35
vendor/phpoffice/math/src/Math/Element/AbstractGroupElement.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\Math\Element;
|
||||
|
||||
abstract class AbstractGroupElement extends AbstractElement
|
||||
{
|
||||
/**
|
||||
* @var AbstractElement[]
|
||||
*/
|
||||
protected $elements = [];
|
||||
|
||||
public function add(AbstractElement $element): self
|
||||
{
|
||||
$this->elements[] = $element;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function remove(AbstractElement $element): self
|
||||
{
|
||||
$this->elements = array_filter($this->elements, function ($child) use ($element) {
|
||||
return $child != $element;
|
||||
});
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AbstractElement[]
|
||||
*/
|
||||
public function getElements(): array
|
||||
{
|
||||
return $this->elements;
|
||||
}
|
||||
}
|
||||
46
vendor/phpoffice/math/src/Math/Element/Fraction.php
vendored
Normal file
46
vendor/phpoffice/math/src/Math/Element/Fraction.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\Math\Element;
|
||||
|
||||
class Fraction extends AbstractElement
|
||||
{
|
||||
/**
|
||||
* @var AbstractElement
|
||||
*/
|
||||
protected $denominator;
|
||||
|
||||
/**
|
||||
* @var AbstractElement
|
||||
*/
|
||||
protected $numerator;
|
||||
|
||||
public function __construct(AbstractElement $numerator, AbstractElement $denominator)
|
||||
{
|
||||
$this->setNumerator($numerator);
|
||||
$this->setDenominator($denominator);
|
||||
}
|
||||
|
||||
public function getDenominator(): AbstractElement
|
||||
{
|
||||
return $this->denominator;
|
||||
}
|
||||
|
||||
public function getNumerator(): AbstractElement
|
||||
{
|
||||
return $this->numerator;
|
||||
}
|
||||
|
||||
public function setDenominator(AbstractElement $element): self
|
||||
{
|
||||
$this->denominator = $element;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setNumerator(AbstractElement $element): self
|
||||
{
|
||||
$this->numerator = $element;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
21
vendor/phpoffice/math/src/Math/Element/Identifier.php
vendored
Normal file
21
vendor/phpoffice/math/src/Math/Element/Identifier.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\Math\Element;
|
||||
|
||||
class Identifier extends AbstractElement
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
public function __construct(string $value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function getValue(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
21
vendor/phpoffice/math/src/Math/Element/Numeric.php
vendored
Normal file
21
vendor/phpoffice/math/src/Math/Element/Numeric.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\Math\Element;
|
||||
|
||||
class Numeric extends AbstractElement
|
||||
{
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
public function __construct(float $value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function getValue(): float
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
21
vendor/phpoffice/math/src/Math/Element/Operator.php
vendored
Normal file
21
vendor/phpoffice/math/src/Math/Element/Operator.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\Math\Element;
|
||||
|
||||
class Operator extends AbstractElement
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
public function __construct(string $value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function getValue(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
7
vendor/phpoffice/math/src/Math/Element/Row.php
vendored
Normal file
7
vendor/phpoffice/math/src/Math/Element/Row.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\Math\Element;
|
||||
|
||||
class Row extends AbstractGroupElement
|
||||
{
|
||||
}
|
||||
33
vendor/phpoffice/math/src/Math/Element/Semantics.php
vendored
Normal file
33
vendor/phpoffice/math/src/Math/Element/Semantics.php
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PhpOffice\Math\Element;
|
||||
|
||||
class Semantics extends AbstractGroupElement
|
||||
{
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $annotations = [];
|
||||
|
||||
public function addAnnotation(string $encoding, string $annotation): self
|
||||
{
|
||||
$this->annotations[$encoding] = $annotation;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAnnotation(string $encoding): ?string
|
||||
{
|
||||
return $this->annotations[$encoding] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function getAnnotations(): array
|
||||
{
|
||||
return $this->annotations;
|
||||
}
|
||||
}
|
||||
46
vendor/phpoffice/math/src/Math/Element/Superscript.php
vendored
Normal file
46
vendor/phpoffice/math/src/Math/Element/Superscript.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace PhpOffice\Math\Element;
|
||||
|
||||
class Superscript extends AbstractElement
|
||||
{
|
||||
/**
|
||||
* @var AbstractElement
|
||||
*/
|
||||
protected $base;
|
||||
|
||||
/**
|
||||
* @var AbstractElement
|
||||
*/
|
||||
protected $superscript;
|
||||
|
||||
public function __construct(AbstractElement $base, AbstractElement $superscript)
|
||||
{
|
||||
$this->setBase($base);
|
||||
$this->setSuperscript($superscript);
|
||||
}
|
||||
|
||||
public function getBase(): AbstractElement
|
||||
{
|
||||
return $this->base;
|
||||
}
|
||||
|
||||
public function getSuperscript(): AbstractElement
|
||||
{
|
||||
return $this->superscript;
|
||||
}
|
||||
|
||||
public function setBase(AbstractElement $element): self
|
||||
{
|
||||
$this->base = $element;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSuperscript(AbstractElement $element): self
|
||||
{
|
||||
$this->superscript = $element;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user