-
-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,11 @@ | |
|
||
namespace Symfony\UX\Map; | ||
|
||
/** | ||
* @author Sylvain Blondeau <[email protected]> | ||
* | ||
* @internal | ||
*/ | ||
interface Element | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,12 @@ | |
* Represents a collection of map elements. | ||
* | ||
* @author Sylvain Blondeau <[email protected]> | ||
* | ||
* @internal | ||
*/ | ||
abstract class Elements | ||
{ | ||
protected \SplObjectStorage $elements; | ||
private \SplObjectStorage $elements; | ||
|
||
public function __construct( | ||
array $elements, | ||
|
@@ -29,7 +31,7 @@ public function __construct( | |
} | ||
} | ||
|
||
public function add(Element $element): self | ||
public function add(Element $element): static | ||
{ | ||
$this->elements->attach($element, $element->id ?? $this->elements->getHash($element)); | ||
|
||
|
@@ -47,7 +49,7 @@ private function getElement(string $id): ?Element | |
return null; | ||
} | ||
|
||
public function remove(Element|string $elementOrId): self | ||
public function remove(Element|string $elementOrId): static | ||
{ | ||
if (\is_string($elementOrId)) { | ||
$elementOrId = $this->getElement($elementOrId); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ | |
* Represents a Marker collection. | ||
* | ||
* @author Sylvain Blondeau <[email protected]> | ||
* | ||
* @internal | ||
*/ | ||
final class Markers extends Elements | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ | |
* Represents a Polygon collection. | ||
* | ||
* @author Sylvain Blondeau <[email protected]> | ||
* | ||
* @internal | ||
*/ | ||
final class Polygons extends Elements | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ | |
* Represents a Polyline collection. | ||
* | ||
* @author Sylvain Blondeau <[email protected]> | ||
* | ||
* @internal | ||
*/ | ||
final class Polylines extends Elements | ||
{ | ||
|