PhpElement.php 799 B

123456789101112131415161718192021222324252627
  1. <?php declare(strict_types = 1);
  2. /*
  3. * This file is part of PharIo\Manifest.
  4. *
  5. * Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. *
  10. */
  11. namespace PharIo\Manifest;
  12. class PhpElement extends ManifestElement {
  13. public function getVersion(): string {
  14. return $this->getAttributeValue('version');
  15. }
  16. public function hasExtElements(): bool {
  17. return $this->hasChild('ext');
  18. }
  19. public function getExtElements(): ExtElementCollection {
  20. return new ExtElementCollection(
  21. $this->getChildrenByName('ext')
  22. );
  23. }
  24. }