N, [>=M, !=N,
getEnd()->getOperator() === '<' && $i+1 < $count) {
+ $nextInterval = $intervals['numeric'][$i+1];
+ if ($interval->getEnd()->getVersion() === $nextInterval->getStart()->getVersion() && $nextInterval->getStart()->getOperator() === '>') {
+ // only add a start if we didn't already do so, can be skipped if we're looking at second
+ // interval in [>=M, N, P, =M, !=N] already and we only want to add !=P right now
+ if (\count($unEqualConstraints) === 0 && (string) $interval->getStart() !== (string) Interval::fromZero()) {
+ $unEqualConstraints[] = $interval->getStart();
+ }
+ $unEqualConstraints[] = new Constraint('!=', $interval->getEnd()->getVersion());
+ continue;
+ }
+ }
+
+ if (\count($unEqualConstraints) > 0) {
+ // this is where the end of the following interval of a != constraint is added as explained above
+ if ((string) $interval->getEnd() !== (string) Interval::untilPositiveInfinity()) {
+ $unEqualConstraints[] = $interval->getEnd();
+ }
+
+ // count is 1 if entire constraint is just one != expression
+ if (\count($unEqualConstraints) > 1) {
+ $constraints[] = new MultiConstraint($unEqualConstraints, true);
+ } else {
+ $constraints[] = $unEqualConstraints[0];
+ }
+
+ $unEqualConstraints = array();
+ continue;
+ }
+
+ // convert back >= x - <= x intervals to == x
+ if ($interval->getStart()->getVersion() === $interval->getEnd()->getVersion() && $interval->getStart()->getOperator() === '>=' && $interval->getEnd()->getOperator() === '<=') {
+ $constraints[] = new Constraint('==', $interval->getStart()->getVersion());
+ continue;
+ }
+
+ if ((string) $interval->getStart() === (string) Interval::fromZero()) {
+ $constraints[] = $interval->getEnd();
+ } elseif ((string) $interval->getEnd() === (string) Interval::untilPositiveInfinity()) {
+ $constraints[] = $interval->getStart();
+ } else {
+ $constraints[] = new MultiConstraint(array($interval->getStart(), $interval->getEnd()), true);
+ }
+ }
+ }
+
+ $devConstraints = array();
+
+ if (0 === \count($intervals['branches']['names'])) {
+ if ($intervals['branches']['exclude']) {
+ if ($hasNumericMatchAll) {
+ return new MatchAllConstraint;
+ }
+ // otherwise constraint should contain a != operator and already cover this
+ }
+ } else {
+ foreach ($intervals['branches']['names'] as $branchName) {
+ if ($intervals['branches']['exclude']) {
+ $devConstraints[] = new Constraint('!=', $branchName);
+ } else {
+ $devConstraints[] = new Constraint('==', $branchName);
+ }
+ }
+
+ // excluded branches, e.g. != dev-foo are conjunctive with the interval, so
+ // > 2.0 != dev-foo must return a conjunctive constraint
+ if ($intervals['branches']['exclude']) {
+ if (\count($constraints) > 1) {
+ return new MultiConstraint(array_merge(
+ array(new MultiConstraint($constraints, false)),
+ $devConstraints
+ ), true);
+ }
+
+ if (\count($constraints) === 1 && (string)$constraints[0] === (string)Interval::fromZero()) {
+ if (\count($devConstraints) > 1) {
+ return new MultiConstraint($devConstraints, true);
+ }
+ return $devConstraints[0];
+ }
+
+ return new MultiConstraint(array_merge($constraints, $devConstraints), true);
+ }
+
+ // otherwise devConstraints contains a list of == operators for branches which are disjunctive with the
+ // rest of the constraint
+ $constraints = array_merge($constraints, $devConstraints);
+ }
+
+ if (\count($constraints) > 1) {
+ return new MultiConstraint($constraints, false);
+ }
+
+ if (\count($constraints) === 1) {
+ return $constraints[0];
+ }
+
+ return new MatchNoneConstraint;
+ }
+
+ /**
+ * Creates an array of numeric intervals and branch constraints representing a given constraint
+ *
+ * if the returned numeric array is empty it means the constraint matches nothing in the numeric range (0 - +inf)
+ * if the returned branches array is empty it means no dev-* versions are matched
+ * if a constraint matches all possible dev-* versions, branches will contain Interval::anyDev()
+ *
+ * @return array
+ * @phpstan-return array{'numeric': Interval[], 'branches': array{'names': string[], 'exclude': bool}}
+ */
+ public static function get(ConstraintInterface $constraint)
+ {
+ $key = (string) $constraint;
+
+ if (!isset(self::$intervalsCache[$key])) {
+ self::$intervalsCache[$key] = self::generateIntervals($constraint);
+ }
+
+ return self::$intervalsCache[$key];
+ }
+
+ /**
+ * @param bool $stopOnFirstValidInterval
+ *
+ * @phpstan-return array{'numeric': Interval[], 'branches': array{'names': string[], 'exclude': bool}}
+ */
+ private static function generateIntervals(ConstraintInterface $constraint, $stopOnFirstValidInterval = false)
+ {
+ if ($constraint instanceof MatchAllConstraint) {
+ return array('numeric' => array(new Interval(Interval::fromZero(), Interval::untilPositiveInfinity())), 'branches' => Interval::anyDev());
+ }
+
+ if ($constraint instanceof MatchNoneConstraint) {
+ return array('numeric' => array(), 'branches' => array('names' => array(), 'exclude' => false));
+ }
+
+ if ($constraint instanceof Constraint) {
+ return self::generateSingleConstraintIntervals($constraint);
+ }
+
+ if (!$constraint instanceof MultiConstraint) {
+ throw new \UnexpectedValueException('The constraint passed in should be an MatchAllConstraint, Constraint or MultiConstraint instance, got '.\get_class($constraint).'.');
+ }
+
+ $constraints = $constraint->getConstraints();
+
+ $numericGroups = array();
+ $constraintBranches = array();
+ foreach ($constraints as $c) {
+ $res = self::get($c);
+ $numericGroups[] = $res['numeric'];
+ $constraintBranches[] = $res['branches'];
+ }
+
+ if ($constraint->isDisjunctive()) {
+ $branches = Interval::noDev();
+ foreach ($constraintBranches as $b) {
+ if ($b['exclude']) {
+ if ($branches['exclude']) {
+ // disjunctive constraint, so only exclude what's excluded in all constraints
+ // !=a,!=b || !=b,!=c => !=b
+ $branches['names'] = array_intersect($branches['names'], $b['names']);
+ } else {
+ // disjunctive constraint so exclude all names which are not explicitly included in the alternative
+ // (==b || ==c) || !=a,!=b => !=a
+ $branches['exclude'] = true;
+ $branches['names'] = array_diff($b['names'], $branches['names']);
+ }
+ } else {
+ if ($branches['exclude']) {
+ // disjunctive constraint so exclude all names which are not explicitly included in the alternative
+ // !=a,!=b || (==b || ==c) => !=a
+ $branches['names'] = array_diff($branches['names'], $b['names']);
+ } else {
+ // disjunctive constraint, so just add all the other branches
+ // (==a || ==b) || ==c => ==a || ==b || ==c
+ $branches['names'] = array_merge($branches['names'], $b['names']);
+ }
+ }
+ }
+ } else {
+ $branches = Interval::anyDev();
+ foreach ($constraintBranches as $b) {
+ if ($b['exclude']) {
+ if ($branches['exclude']) {
+ // conjunctive, so just add all branch names to be excluded
+ // !=a && !=b => !=a,!=b
+ $branches['names'] = array_merge($branches['names'], $b['names']);
+ } else {
+ // conjunctive, so only keep included names which are not excluded
+ // (==a||==c) && !=a,!=b => ==c
+ $branches['names'] = array_diff($branches['names'], $b['names']);
+ }
+ } else {
+ if ($branches['exclude']) {
+ // conjunctive, so only keep included names which are not excluded
+ // !=a,!=b && (==a||==c) => ==c
+ $branches['names'] = array_diff($b['names'], $branches['names']);
+ $branches['exclude'] = false;
+ } else {
+ // conjunctive, so only keep names that are included in both
+ // (==a||==b) && (==a||==c) => ==a
+ $branches['names'] = array_intersect($branches['names'], $b['names']);
+ }
+ }
+ }
+ }
+
+ $branches['names'] = array_unique($branches['names']);
+
+ if (\count($numericGroups) === 1) {
+ return array('numeric' => $numericGroups[0], 'branches' => $branches);
+ }
+
+ $borders = array();
+ foreach ($numericGroups as $group) {
+ foreach ($group as $interval) {
+ $borders[] = array('version' => $interval->getStart()->getVersion(), 'operator' => $interval->getStart()->getOperator(), 'side' => 'start');
+ $borders[] = array('version' => $interval->getEnd()->getVersion(), 'operator' => $interval->getEnd()->getOperator(), 'side' => 'end');
+ }
+ }
+
+ $opSortOrder = self::$opSortOrder;
+ usort($borders, function ($a, $b) use ($opSortOrder) {
+ $order = version_compare($a['version'], $b['version']);
+ if ($order === 0) {
+ return $opSortOrder[$a['operator']] - $opSortOrder[$b['operator']];
+ }
+
+ return $order;
+ });
+
+ $activeIntervals = 0;
+ $intervals = array();
+ $index = 0;
+ $activationThreshold = $constraint->isConjunctive() ? \count($numericGroups) : 1;
+ $start = null;
+ foreach ($borders as $border) {
+ if ($border['side'] === 'start') {
+ $activeIntervals++;
+ } else {
+ $activeIntervals--;
+ }
+ if (!$start && $activeIntervals >= $activationThreshold) {
+ $start = new Constraint($border['operator'], $border['version']);
+ } elseif ($start && $activeIntervals < $activationThreshold) {
+ // filter out invalid intervals like > x - <= x, or >= x - < x
+ if (
+ version_compare($start->getVersion(), $border['version'], '=')
+ && (
+ ($start->getOperator() === '>' && $border['operator'] === '<=')
+ || ($start->getOperator() === '>=' && $border['operator'] === '<')
+ )
+ ) {
+ unset($intervals[$index]);
+ } else {
+ $intervals[$index] = new Interval($start, new Constraint($border['operator'], $border['version']));
+ $index++;
+
+ if ($stopOnFirstValidInterval) {
+ break;
+ }
+ }
+
+ $start = null;
+ }
+ }
+
+ return array('numeric' => $intervals, 'branches' => $branches);
+ }
+
+ /**
+ * @phpstan-return array{'numeric': Interval[], 'branches': array{'names': string[], 'exclude': bool}}
+ */
+ private static function generateSingleConstraintIntervals(Constraint $constraint)
+ {
+ $op = $constraint->getOperator();
+
+ // handle branch constraints first
+ if (strpos($constraint->getVersion(), 'dev-') === 0) {
+ $intervals = array();
+ $branches = array('names' => array(), 'exclude' => false);
+
+ // != dev-foo means any numeric version may match, we treat >/< like != they are not really defined for branches
+ if ($op === '!=') {
+ $intervals[] = new Interval(Interval::fromZero(), Interval::untilPositiveInfinity());
+ $branches = array('names' => array($constraint->getVersion()), 'exclude' => true);
+ } elseif ($op === '==') {
+ $branches['names'][] = $constraint->getVersion();
+ }
+
+ return array(
+ 'numeric' => $intervals,
+ 'branches' => $branches,
+ );
+ }
+
+ if ($op[0] === '>') { // > & >=
+ return array('numeric' => array(new Interval($constraint, Interval::untilPositiveInfinity())), 'branches' => Interval::noDev());
+ }
+ if ($op[0] === '<') { // < & <=
+ return array('numeric' => array(new Interval(Interval::fromZero(), $constraint)), 'branches' => Interval::noDev());
+ }
+ if ($op === '!=') {
+ // convert !=x to intervals of 0 - x - +inf + dev*
+ return array('numeric' => array(
+ new Interval(Interval::fromZero(), new Constraint('<', $constraint->getVersion())),
+ new Interval(new Constraint('>', $constraint->getVersion()), Interval::untilPositiveInfinity()),
+ ), 'branches' => Interval::anyDev());
+ }
+
+ // convert ==x to an interval of >=x - <=x
+ return array('numeric' => array(
+ new Interval(new Constraint('>=', $constraint->getVersion()), new Constraint('<=', $constraint->getVersion())),
+ ), 'branches' => Interval::noDev());
+ }
+}
diff --git a/trilhas_poo/vendor/composer/semver/src/Semver.php b/trilhas_poo/vendor/composer/semver/src/Semver.php
new file mode 100644
index 0000000..4fe9075
--- /dev/null
+++ b/trilhas_poo/vendor/composer/semver/src/Semver.php
@@ -0,0 +1,129 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Semver;
+
+use Composer\Semver\Constraint\Constraint;
+
+class Semver
+{
+ const SORT_ASC = 1;
+ const SORT_DESC = -1;
+
+ /** @var VersionParser */
+ private static $versionParser;
+
+ /**
+ * Determine if given version satisfies given constraints.
+ *
+ * @param string $version
+ * @param string $constraints
+ *
+ * @return bool
+ */
+ public static function satisfies($version, $constraints)
+ {
+ if (null === self::$versionParser) {
+ self::$versionParser = new VersionParser();
+ }
+
+ $versionParser = self::$versionParser;
+ $provider = new Constraint('==', $versionParser->normalize($version));
+ $parsedConstraints = $versionParser->parseConstraints($constraints);
+
+ return $parsedConstraints->matches($provider);
+ }
+
+ /**
+ * Return all versions that satisfy given constraints.
+ *
+ * @param string[] $versions
+ * @param string $constraints
+ *
+ * @return list
+ */
+ public static function satisfiedBy(array $versions, $constraints)
+ {
+ $versions = array_filter($versions, function ($version) use ($constraints) {
+ return Semver::satisfies($version, $constraints);
+ });
+
+ return array_values($versions);
+ }
+
+ /**
+ * Sort given array of versions.
+ *
+ * @param string[] $versions
+ *
+ * @return list
+ */
+ public static function sort(array $versions)
+ {
+ return self::usort($versions, self::SORT_ASC);
+ }
+
+ /**
+ * Sort given array of versions in reverse.
+ *
+ * @param string[] $versions
+ *
+ * @return list
+ */
+ public static function rsort(array $versions)
+ {
+ return self::usort($versions, self::SORT_DESC);
+ }
+
+ /**
+ * @param string[] $versions
+ * @param int $direction
+ *
+ * @return list
+ */
+ private static function usort(array $versions, $direction)
+ {
+ if (null === self::$versionParser) {
+ self::$versionParser = new VersionParser();
+ }
+
+ $versionParser = self::$versionParser;
+ $normalized = array();
+
+ // Normalize outside of usort() scope for minor performance increase.
+ // Creates an array of arrays: [[normalized, key], ...]
+ foreach ($versions as $key => $version) {
+ $normalizedVersion = $versionParser->normalize($version);
+ $normalizedVersion = $versionParser->normalizeDefaultBranch($normalizedVersion);
+ $normalized[] = array($normalizedVersion, $key);
+ }
+
+ usort($normalized, function (array $left, array $right) use ($direction) {
+ if ($left[0] === $right[0]) {
+ return 0;
+ }
+
+ if (Comparator::lessThan($left[0], $right[0])) {
+ return -$direction;
+ }
+
+ return $direction;
+ });
+
+ // Recreate input array, using the original indexes which are now in sorted order.
+ $sorted = array();
+ foreach ($normalized as $item) {
+ $sorted[] = $versions[$item[1]];
+ }
+
+ return $sorted;
+ }
+}
diff --git a/trilhas_poo/vendor/composer/semver/src/VersionParser.php b/trilhas_poo/vendor/composer/semver/src/VersionParser.php
new file mode 100644
index 0000000..305a0fa
--- /dev/null
+++ b/trilhas_poo/vendor/composer/semver/src/VersionParser.php
@@ -0,0 +1,591 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Semver;
+
+use Composer\Semver\Constraint\ConstraintInterface;
+use Composer\Semver\Constraint\MatchAllConstraint;
+use Composer\Semver\Constraint\MultiConstraint;
+use Composer\Semver\Constraint\Constraint;
+
+/**
+ * Version parser.
+ *
+ * @author Jordi Boggiano
+ */
+class VersionParser
+{
+ /**
+ * Regex to match pre-release data (sort of).
+ *
+ * Due to backwards compatibility:
+ * - Instead of enforcing hyphen, an underscore, dot or nothing at all are also accepted.
+ * - Only stabilities as recognized by Composer are allowed to precede a numerical identifier.
+ * - Numerical-only pre-release identifiers are not supported, see tests.
+ *
+ * |--------------|
+ * [major].[minor].[patch] -[pre-release] +[build-metadata]
+ *
+ * @var string
+ */
+ private static $modifierRegex = '[._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\d+)*+)?)?([.-]?dev)?';
+
+ /** @var string */
+ private static $stabilitiesRegex = 'stable|RC|beta|alpha|dev';
+
+ /**
+ * Returns the stability of a version.
+ *
+ * @param string $version
+ *
+ * @return string
+ * @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev'
+ */
+ public static function parseStability($version)
+ {
+ $version = (string) preg_replace('{#.+$}', '', (string) $version);
+
+ if (strpos($version, 'dev-') === 0 || '-dev' === substr($version, -4)) {
+ return 'dev';
+ }
+
+ preg_match('{' . self::$modifierRegex . '(?:\+.*)?$}i', strtolower($version), $match);
+
+ if (!empty($match[3])) {
+ return 'dev';
+ }
+
+ if (!empty($match[1])) {
+ if ('beta' === $match[1] || 'b' === $match[1]) {
+ return 'beta';
+ }
+ if ('alpha' === $match[1] || 'a' === $match[1]) {
+ return 'alpha';
+ }
+ if ('rc' === $match[1]) {
+ return 'RC';
+ }
+ }
+
+ return 'stable';
+ }
+
+ /**
+ * @param string $stability
+ *
+ * @return string
+ * @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev'
+ */
+ public static function normalizeStability($stability)
+ {
+ $stability = strtolower((string) $stability);
+
+ if (!in_array($stability, array('stable', 'rc', 'beta', 'alpha', 'dev'), true)) {
+ throw new \InvalidArgumentException('Invalid stability string "'.$stability.'", expected one of stable, RC, beta, alpha or dev');
+ }
+
+ return $stability === 'rc' ? 'RC' : $stability;
+ }
+
+ /**
+ * Normalizes a version string to be able to perform comparisons on it.
+ *
+ * @param string $version
+ * @param ?string $fullVersion optional complete version string to give more context
+ *
+ * @throws \UnexpectedValueException
+ *
+ * @return string
+ */
+ public function normalize($version, $fullVersion = null)
+ {
+ $version = trim((string) $version);
+ $origVersion = $version;
+ if (null === $fullVersion) {
+ $fullVersion = $version;
+ }
+
+ // strip off aliasing
+ if (preg_match('{^([^,\s]++) ++as ++([^,\s]++)$}', $version, $match)) {
+ $version = $match[1];
+ }
+
+ // strip off stability flag
+ if (preg_match('{@(?:' . self::$stabilitiesRegex . ')$}i', $version, $match)) {
+ $version = substr($version, 0, strlen($version) - strlen($match[0]));
+ }
+
+ // normalize master/trunk/default branches to dev-name for BC with 1.x as these used to be valid constraints
+ if (\in_array($version, array('master', 'trunk', 'default'), true)) {
+ $version = 'dev-' . $version;
+ }
+
+ // if requirement is branch-like, use full name
+ if (stripos($version, 'dev-') === 0) {
+ return 'dev-' . substr($version, 4);
+ }
+
+ // strip off build metadata
+ if (preg_match('{^([^,\s+]++)\+[^\s]++$}', $version, $match)) {
+ $version = $match[1];
+ }
+
+ // match classical versioning
+ if (preg_match('{^v?(\d{1,5}+)(\.\d++)?(\.\d++)?(\.\d++)?' . self::$modifierRegex . '$}i', $version, $matches)) {
+ $version = $matches[1]
+ . (!empty($matches[2]) ? $matches[2] : '.0')
+ . (!empty($matches[3]) ? $matches[3] : '.0')
+ . (!empty($matches[4]) ? $matches[4] : '.0');
+ $index = 5;
+ // match date(time) based versioning
+ } elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3}){0,2})' . self::$modifierRegex . '$}i', $version, $matches)) {
+ $version = (string) preg_replace('{\D}', '.', $matches[1]);
+ $index = 2;
+ }
+
+ // add version modifiers if a version was matched
+ if (isset($index)) {
+ if (!empty($matches[$index])) {
+ if ('stable' === $matches[$index]) {
+ return $version;
+ }
+ $version .= '-' . $this->expandStability($matches[$index]) . (isset($matches[$index + 1]) && '' !== $matches[$index + 1] ? ltrim($matches[$index + 1], '.-') : '');
+ }
+
+ if (!empty($matches[$index + 2])) {
+ $version .= '-dev';
+ }
+
+ return $version;
+ }
+
+ // match dev branches
+ if (preg_match('{(.*?)[.-]?dev$}i', $version, $match)) {
+ try {
+ $normalized = $this->normalizeBranch($match[1]);
+ // a branch ending with -dev is only valid if it is numeric
+ // if it gets prefixed with dev- it means the branch name should
+ // have had a dev- prefix already when passed to normalize
+ if (strpos($normalized, 'dev-') === false) {
+ return $normalized;
+ }
+ } catch (\Exception $e) {
+ }
+ }
+
+ $extraMessage = '';
+ if (preg_match('{ +as +' . preg_quote($version) . '(?:@(?:'.self::$stabilitiesRegex.'))?$}', $fullVersion)) {
+ $extraMessage = ' in "' . $fullVersion . '", the alias must be an exact version';
+ } elseif (preg_match('{^' . preg_quote($version) . '(?:@(?:'.self::$stabilitiesRegex.'))? +as +}', $fullVersion)) {
+ $extraMessage = ' in "' . $fullVersion . '", the alias source must be an exact version, if it is a branch name you should prefix it with dev-';
+ }
+
+ throw new \UnexpectedValueException('Invalid version string "' . $origVersion . '"' . $extraMessage);
+ }
+
+ /**
+ * Extract numeric prefix from alias, if it is in numeric format, suitable for version comparison.
+ *
+ * @param string $branch Branch name (e.g. 2.1.x-dev)
+ *
+ * @return string|false Numeric prefix if present (e.g. 2.1.) or false
+ */
+ public function parseNumericAliasPrefix($branch)
+ {
+ if (preg_match('{^(?P(\d++\\.)*\d++)(?:\.x)?-dev$}i', (string) $branch, $matches)) {
+ return $matches['version'] . '.';
+ }
+
+ return false;
+ }
+
+ /**
+ * Normalizes a branch name to be able to perform comparisons on it.
+ *
+ * @param string $name
+ *
+ * @return string
+ */
+ public function normalizeBranch($name)
+ {
+ $name = trim((string) $name);
+
+ if (preg_match('{^v?(\d++)(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?$}i', $name, $matches)) {
+ $version = '';
+ for ($i = 1; $i < 5; ++$i) {
+ $version .= isset($matches[$i]) ? str_replace(array('*', 'X'), 'x', $matches[$i]) : '.x';
+ }
+
+ return str_replace('x', '9999999', $version) . '-dev';
+ }
+
+ return 'dev-' . $name;
+ }
+
+ /**
+ * Normalizes a default branch name (i.e. master on git) to 9999999-dev.
+ *
+ * @param string $name
+ *
+ * @return string
+ *
+ * @deprecated No need to use this anymore in theory, Composer 2 does not normalize any branch names to 9999999-dev anymore
+ */
+ public function normalizeDefaultBranch($name)
+ {
+ if ($name === 'dev-master' || $name === 'dev-default' || $name === 'dev-trunk') {
+ return '9999999-dev';
+ }
+
+ return (string) $name;
+ }
+
+ /**
+ * Parses a constraint string into MultiConstraint and/or Constraint objects.
+ *
+ * @param string $constraints
+ *
+ * @return ConstraintInterface
+ */
+ public function parseConstraints($constraints)
+ {
+ $prettyConstraint = (string) $constraints;
+
+ $orConstraints = preg_split('{\s*\|\|?\s*}', trim((string) $constraints));
+ if (false === $orConstraints) {
+ throw new \RuntimeException('Failed to preg_split string: '.$constraints);
+ }
+ $orGroups = array();
+
+ foreach ($orConstraints as $orConstraint) {
+ $andConstraints = preg_split('{(?< ,]) *(? 1) {
+ $constraintObjects = array();
+ foreach ($andConstraints as $andConstraint) {
+ foreach ($this->parseConstraint($andConstraint) as $parsedAndConstraint) {
+ $constraintObjects[] = $parsedAndConstraint;
+ }
+ }
+ } else {
+ $constraintObjects = $this->parseConstraint($andConstraints[0]);
+ }
+
+ if (1 === \count($constraintObjects)) {
+ $constraint = $constraintObjects[0];
+ } else {
+ $constraint = new MultiConstraint($constraintObjects);
+ }
+
+ $orGroups[] = $constraint;
+ }
+
+ $parsedConstraint = MultiConstraint::create($orGroups, false);
+
+ $parsedConstraint->setPrettyString($prettyConstraint);
+
+ return $parsedConstraint;
+ }
+
+ /**
+ * @param string $constraint
+ *
+ * @throws \UnexpectedValueException
+ *
+ * @return array
+ *
+ * @phpstan-return non-empty-array
+ */
+ private function parseConstraint($constraint)
+ {
+ // strip off aliasing
+ if (preg_match('{^([^,\s]++) ++as ++([^,\s]++)$}', $constraint, $match)) {
+ $constraint = $match[1];
+ }
+
+ // strip @stability flags, and keep it for later use
+ if (preg_match('{^([^,\s]*?)@(' . self::$stabilitiesRegex . ')$}i', $constraint, $match)) {
+ $constraint = '' !== $match[1] ? $match[1] : '*';
+ if ($match[2] !== 'stable') {
+ $stabilityModifier = $match[2];
+ }
+ }
+
+ // get rid of #refs as those are used by composer only
+ if (preg_match('{^(dev-[^,\s@]+?|[^,\s@]+?\.x-dev)#.+$}i', $constraint, $match)) {
+ $constraint = $match[1];
+ }
+
+ if (preg_match('{^(v)?[xX*](\.[xX*])*$}i', $constraint, $match)) {
+ if (!empty($match[1]) || !empty($match[2])) {
+ return array(new Constraint('>=', '0.0.0.0-dev'));
+ }
+
+ return array(new MatchAllConstraint());
+ }
+
+ $versionRegex = 'v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.(\d++))?(?:' . self::$modifierRegex . '|\.([xX*][.-]?dev))(?:\+[^\s]+)?';
+
+ // Tilde Range
+ //
+ // Like wildcard constraints, unsuffixed tilde constraints say that they must be greater than the previous
+ // version, to ensure that unstable instances of the current version are allowed. However, if a stability
+ // suffix is added to the constraint, then a >= match on the current version is used instead.
+ if (preg_match('{^~>?' . $versionRegex . '$}i', $constraint, $matches)) {
+ if (strpos($constraint, '~>') === 0) {
+ throw new \UnexpectedValueException(
+ 'Could not parse version constraint ' . $constraint . ': ' .
+ 'Invalid operator "~>", you probably meant to use the "~" operator'
+ );
+ }
+
+ // Work out which position in the version we are operating at
+ if (isset($matches[4]) && '' !== $matches[4] && null !== $matches[4]) {
+ $position = 4;
+ } elseif (isset($matches[3]) && '' !== $matches[3] && null !== $matches[3]) {
+ $position = 3;
+ } elseif (isset($matches[2]) && '' !== $matches[2] && null !== $matches[2]) {
+ $position = 2;
+ } else {
+ $position = 1;
+ }
+
+ // when matching 2.x-dev or 3.0.x-dev we have to shift the second or third number, despite no second/third number matching above
+ if (!empty($matches[8])) {
+ $position++;
+ }
+
+ // Calculate the stability suffix
+ $stabilitySuffix = '';
+ if (empty($matches[5]) && empty($matches[7]) && empty($matches[8])) {
+ $stabilitySuffix .= '-dev';
+ }
+
+ $lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1));
+ $lowerBound = new Constraint('>=', $lowVersion);
+
+ // For upper bound, we increment the position of one more significance,
+ // but highPosition = 0 would be illegal
+ $highPosition = max(1, $position - 1);
+ $highVersion = $this->manipulateVersionString($matches, $highPosition, 1) . '-dev';
+ $upperBound = new Constraint('<', $highVersion);
+
+ return array(
+ $lowerBound,
+ $upperBound,
+ );
+ }
+
+ // Caret Range
+ //
+ // Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple.
+ // In other words, this allows patch and minor updates for versions 1.0.0 and above, patch updates for
+ // versions 0.X >=0.1.0, and no updates for versions 0.0.X
+ if (preg_match('{^\^' . $versionRegex . '($)}i', $constraint, $matches)) {
+ // Work out which position in the version we are operating at
+ if ('0' !== $matches[1] || '' === $matches[2] || null === $matches[2]) {
+ $position = 1;
+ } elseif ('0' !== $matches[2] || '' === $matches[3] || null === $matches[3]) {
+ $position = 2;
+ } else {
+ $position = 3;
+ }
+
+ // Calculate the stability suffix
+ $stabilitySuffix = '';
+ if (empty($matches[5]) && empty($matches[7]) && empty($matches[8])) {
+ $stabilitySuffix .= '-dev';
+ }
+
+ $lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1));
+ $lowerBound = new Constraint('>=', $lowVersion);
+
+ // For upper bound, we increment the position of one more significance,
+ // but highPosition = 0 would be illegal
+ $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev';
+ $upperBound = new Constraint('<', $highVersion);
+
+ return array(
+ $lowerBound,
+ $upperBound,
+ );
+ }
+
+ // X Range
+ //
+ // Any of X, x, or * may be used to "stand in" for one of the numeric values in the [major, minor, patch] tuple.
+ // A partial version range is treated as an X-Range, so the special character is in fact optional.
+ if (preg_match('{^v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.[xX*])++$}', $constraint, $matches)) {
+ if (isset($matches[3]) && '' !== $matches[3] && null !== $matches[3]) {
+ $position = 3;
+ } elseif (isset($matches[2]) && '' !== $matches[2] && null !== $matches[2]) {
+ $position = 2;
+ } else {
+ $position = 1;
+ }
+
+ $lowVersion = $this->manipulateVersionString($matches, $position) . '-dev';
+ $highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev';
+
+ if ($lowVersion === '0.0.0.0-dev') {
+ return array(new Constraint('<', $highVersion));
+ }
+
+ return array(
+ new Constraint('>=', $lowVersion),
+ new Constraint('<', $highVersion),
+ );
+ }
+
+ // Hyphen Range
+ //
+ // Specifies an inclusive set. If a partial version is provided as the first version in the inclusive range,
+ // then the missing pieces are replaced with zeroes. If a partial version is provided as the second version in
+ // the inclusive range, then all versions that start with the supplied parts of the tuple are accepted, but
+ // nothing that would be greater than the provided tuple parts.
+ if (preg_match('{^(?P' . $versionRegex . ') +- +(?P' . $versionRegex . ')($)}i', $constraint, $matches)) {
+ // Calculate the stability suffix
+ $lowStabilitySuffix = '';
+ if (empty($matches[6]) && empty($matches[8]) && empty($matches[9])) {
+ $lowStabilitySuffix = '-dev';
+ }
+
+ $lowVersion = $this->normalize($matches['from']);
+ $lowerBound = new Constraint('>=', $lowVersion . $lowStabilitySuffix);
+
+ $empty = function ($x) {
+ return ($x === 0 || $x === '0') ? false : empty($x);
+ };
+
+ if ((!$empty($matches[12]) && !$empty($matches[13])) || !empty($matches[15]) || !empty($matches[17]) || !empty($matches[18])) {
+ $highVersion = $this->normalize($matches['to']);
+ $upperBound = new Constraint('<=', $highVersion);
+ } else {
+ $highMatch = array('', $matches[11], $matches[12], $matches[13], $matches[14]);
+
+ // validate to version
+ $this->normalize($matches['to']);
+
+ $highVersion = $this->manipulateVersionString($highMatch, $empty($matches[12]) ? 1 : 2, 1) . '-dev';
+ $upperBound = new Constraint('<', $highVersion);
+ }
+
+ return array(
+ $lowerBound,
+ $upperBound,
+ );
+ }
+
+ // Basic Comparators
+ if (preg_match('{^(<>|!=|>=?|<=?|==?)?\s*(.*)}', $constraint, $matches)) {
+ try {
+ try {
+ $version = $this->normalize($matches[2]);
+ } catch (\UnexpectedValueException $e) {
+ // recover from an invalid constraint like foobar-dev which should be dev-foobar
+ // except if the constraint uses a known operator, in which case it must be a parse error
+ if (substr($matches[2], -4) === '-dev' && preg_match('{^[0-9a-zA-Z-./]+$}', $matches[2])) {
+ $version = $this->normalize('dev-'.substr($matches[2], 0, -4));
+ } else {
+ throw $e;
+ }
+ }
+
+ $op = $matches[1] ?: '=';
+
+ if ($op !== '==' && $op !== '=' && !empty($stabilityModifier) && self::parseStability($version) === 'stable') {
+ $version .= '-' . $stabilityModifier;
+ } elseif ('<' === $op || '>=' === $op) {
+ if (!preg_match('/-' . self::$modifierRegex . '$/', strtolower($matches[2]))) {
+ if (strpos($matches[2], 'dev-') !== 0) {
+ $version .= '-dev';
+ }
+ }
+ }
+
+ return array(new Constraint($matches[1] ?: '=', $version));
+ } catch (\Exception $e) {
+ }
+ }
+
+ $message = 'Could not parse version constraint ' . $constraint;
+ if (isset($e)) {
+ $message .= ': ' . $e->getMessage();
+ }
+
+ throw new \UnexpectedValueException($message);
+ }
+
+ /**
+ * Increment, decrement, or simply pad a version number.
+ *
+ * Support function for {@link parseConstraint()}
+ *
+ * @param array $matches Array with version parts in array indexes 1,2,3,4
+ * @param int $position 1,2,3,4 - which segment of the version to increment/decrement
+ * @param int $increment
+ * @param string $pad The string to pad version parts after $position
+ *
+ * @return string|null The new version
+ *
+ * @phpstan-param string[] $matches
+ */
+ private function manipulateVersionString(array $matches, $position, $increment = 0, $pad = '0')
+ {
+ for ($i = 4; $i > 0; --$i) {
+ if ($i > $position) {
+ $matches[$i] = $pad;
+ } elseif ($i === $position && $increment) {
+ $matches[$i] += $increment;
+ // If $matches[$i] was 0, carry the decrement
+ if ($matches[$i] < 0) {
+ $matches[$i] = $pad;
+ --$position;
+
+ // Return null on a carry overflow
+ if ($i === 1) {
+ return null;
+ }
+ }
+ }
+ }
+
+ return $matches[1] . '.' . $matches[2] . '.' . $matches[3] . '.' . $matches[4];
+ }
+
+ /**
+ * Expand shorthand stability string to long version.
+ *
+ * @param string $stability
+ *
+ * @return string
+ */
+ private function expandStability($stability)
+ {
+ $stability = strtolower($stability);
+
+ switch ($stability) {
+ case 'a':
+ return 'alpha';
+ case 'b':
+ return 'beta';
+ case 'p':
+ case 'pl':
+ return 'patch';
+ case 'rc':
+ return 'RC';
+ default:
+ return $stability;
+ }
+ }
+}
diff --git a/trilhas_poo/vendor/composer/xdebug-handler/CHANGELOG.md b/trilhas_poo/vendor/composer/xdebug-handler/CHANGELOG.md
new file mode 100644
index 0000000..62ebe22
--- /dev/null
+++ b/trilhas_poo/vendor/composer/xdebug-handler/CHANGELOG.md
@@ -0,0 +1,143 @@
+## [Unreleased]
+
+## [3.0.5] - 2024-05-06
+ * Fixed: fail restart if PHP_BINARY is not available
+
+## [3.0.4] - 2024-03-26
+ * Added: Functional tests.
+ * Fixed: Incompatibility with PHPUnit 10.
+
+## [3.0.3] - 2022-02-25
+ * Added: support for composer/pcre versions 2 and 3.
+
+## [3.0.2] - 2022-02-24
+ * Fixed: regression in 3.0.1 affecting Xdebug 2
+
+## [3.0.1] - 2022-01-04
+ * Fixed: error when calling `isXdebugActive` before class instantiation.
+
+## [3.0.0] - 2021-12-23
+ * Removed: support for legacy PHP versions (< PHP 7.2.5).
+ * Added: type declarations to arguments and return values.
+ * Added: strict typing to all classes.
+
+## [2.0.3] - 2021-12-08
+ * Added: support, type annotations and refactoring for stricter PHPStan analysis.
+
+## [2.0.2] - 2021-07-31
+ * Added: support for `xdebug_info('mode')` in Xdebug 3.1.
+ * Added: support for Psr\Log versions 2 and 3.
+ * Fixed: remove ini directives from non-cli HOST/PATH sections.
+
+## [2.0.1] - 2021-05-05
+ * Fixed: don't restart if the cwd is a UNC path and cmd.exe will be invoked.
+
+## [2.0.0] - 2021-04-09
+ * Break: this is a major release, see [UPGRADE.md](UPGRADE.md) for more information.
+ * Break: removed optional `$colorOption` constructor param and passthru fallback.
+ * Break: renamed `requiresRestart` param from `$isLoaded` to `$default`.
+ * Break: changed `restart` param `$command` from a string to an array.
+ * Added: support for Xdebug3 to only restart if Xdebug is not running with `xdebug.mode=off`.
+ * Added: `isXdebugActive()` method to determine if Xdebug is still running in the restart.
+ * Added: feature to bypass the shell in PHP-7.4+ by giving `proc_open` an array of arguments.
+ * Added: Process utility class to the API.
+
+## [1.4.6] - 2021-03-25
+ * Fixed: fail restart if `proc_open` has been disabled in `disable_functions`.
+ * Fixed: enable Windows CTRL event handling in the restarted process.
+
+## [1.4.5] - 2020-11-13
+ * Fixed: use `proc_open` when available for correct FD forwarding to the restarted process.
+
+## [1.4.4] - 2020-10-24
+ * Fixed: exception if 'pcntl_signal' is disabled.
+
+## [1.4.3] - 2020-08-19
+ * Fixed: restore SIGINT to default handler in restarted process if no other handler exists.
+
+## [1.4.2] - 2020-06-04
+ * Fixed: ignore SIGINTs to let the restarted process handle them.
+
+## [1.4.1] - 2020-03-01
+ * Fixed: restart fails if an ini file is empty.
+
+## [1.4.0] - 2019-11-06
+ * Added: support for `NO_COLOR` environment variable: https://no-color.org
+ * Added: color support for Hyper terminal: https://github.com/zeit/hyper
+ * Fixed: correct capitalization of Xdebug (apparently).
+ * Fixed: improved handling for uopz extension.
+
+## [1.3.3] - 2019-05-27
+ * Fixed: add environment changes to `$_ENV` if it is being used.
+
+## [1.3.2] - 2019-01-28
+ * Fixed: exit call being blocked by uopz extension, resulting in application code running twice.
+
+## [1.3.1] - 2018-11-29
+ * Fixed: fail restart if `passthru` has been disabled in `disable_functions`.
+ * Fixed: fail restart if an ini file cannot be opened, otherwise settings will be missing.
+
+## [1.3.0] - 2018-08-31
+ * Added: `setPersistent` method to use environment variables for the restart.
+ * Fixed: improved debugging by writing output to stderr.
+ * Fixed: no restart when `php_ini_scanned_files` is not functional and is needed.
+
+## [1.2.1] - 2018-08-23
+ * Fixed: fatal error with apc, when using `apc.mmap_file_mask`.
+
+## [1.2.0] - 2018-08-16
+ * Added: debug information using `XDEBUG_HANDLER_DEBUG`.
+ * Added: fluent interface for setters.
+ * Added: `PhpConfig` helper class for calling PHP sub-processes.
+ * Added: `PHPRC` original value to restart stettings, for use in a restarted process.
+ * Changed: internal procedure to disable ini-scanning, using `-n` command-line option.
+ * Fixed: replaced `escapeshellarg` usage to avoid locale problems.
+ * Fixed: improved color-option handling to respect double-dash delimiter.
+ * Fixed: color-option handling regression from main script changes.
+ * Fixed: improved handling when checking main script.
+ * Fixed: handling for standard input, that never actually did anything.
+ * Fixed: fatal error when ctype extension is not available.
+
+## [1.1.0] - 2018-04-11
+ * Added: `getRestartSettings` method for calling PHP processes in a restarted process.
+ * Added: API definition and @internal class annotations.
+ * Added: protected `requiresRestart` method for extending classes.
+ * Added: `setMainScript` method for applications that change the working directory.
+ * Changed: private `tmpIni` variable to protected for extending classes.
+ * Fixed: environment variables not available in $_SERVER when restored in the restart.
+ * Fixed: relative path problems caused by Phar::interceptFileFuncs.
+ * Fixed: incorrect handling when script file cannot be found.
+
+## [1.0.0] - 2018-03-08
+ * Added: PSR3 logging for optional status output.
+ * Added: existing ini settings are merged to catch command-line overrides.
+ * Added: code, tests and other artefacts to decouple from Composer.
+ * Break: the following class was renamed:
+ - `Composer\XdebugHandler` -> `Composer\XdebugHandler\XdebugHandler`
+
+[Unreleased]: https://github.com/composer/xdebug-handler/compare/3.0.5...HEAD
+[3.0.5]: https://github.com/composer/xdebug-handler/compare/3.0.4...3.0.5
+[3.0.4]: https://github.com/composer/xdebug-handler/compare/3.0.3...3.0.4
+[3.0.3]: https://github.com/composer/xdebug-handler/compare/3.0.2...3.0.3
+[3.0.2]: https://github.com/composer/xdebug-handler/compare/3.0.1...3.0.2
+[3.0.1]: https://github.com/composer/xdebug-handler/compare/3.0.0...3.0.1
+[3.0.0]: https://github.com/composer/xdebug-handler/compare/2.0.3...3.0.0
+[2.0.3]: https://github.com/composer/xdebug-handler/compare/2.0.2...2.0.3
+[2.0.2]: https://github.com/composer/xdebug-handler/compare/2.0.1...2.0.2
+[2.0.1]: https://github.com/composer/xdebug-handler/compare/2.0.0...2.0.1
+[2.0.0]: https://github.com/composer/xdebug-handler/compare/1.4.6...2.0.0
+[1.4.6]: https://github.com/composer/xdebug-handler/compare/1.4.5...1.4.6
+[1.4.5]: https://github.com/composer/xdebug-handler/compare/1.4.4...1.4.5
+[1.4.4]: https://github.com/composer/xdebug-handler/compare/1.4.3...1.4.4
+[1.4.3]: https://github.com/composer/xdebug-handler/compare/1.4.2...1.4.3
+[1.4.2]: https://github.com/composer/xdebug-handler/compare/1.4.1...1.4.2
+[1.4.1]: https://github.com/composer/xdebug-handler/compare/1.4.0...1.4.1
+[1.4.0]: https://github.com/composer/xdebug-handler/compare/1.3.3...1.4.0
+[1.3.3]: https://github.com/composer/xdebug-handler/compare/1.3.2...1.3.3
+[1.3.2]: https://github.com/composer/xdebug-handler/compare/1.3.1...1.3.2
+[1.3.1]: https://github.com/composer/xdebug-handler/compare/1.3.0...1.3.1
+[1.3.0]: https://github.com/composer/xdebug-handler/compare/1.2.1...1.3.0
+[1.2.1]: https://github.com/composer/xdebug-handler/compare/1.2.0...1.2.1
+[1.2.0]: https://github.com/composer/xdebug-handler/compare/1.1.0...1.2.0
+[1.1.0]: https://github.com/composer/xdebug-handler/compare/1.0.0...1.1.0
+[1.0.0]: https://github.com/composer/xdebug-handler/compare/d66f0d15cb57...1.0.0
diff --git a/trilhas_poo/vendor/composer/xdebug-handler/LICENSE b/trilhas_poo/vendor/composer/xdebug-handler/LICENSE
new file mode 100644
index 0000000..963618a
--- /dev/null
+++ b/trilhas_poo/vendor/composer/xdebug-handler/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Composer
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/trilhas_poo/vendor/composer/xdebug-handler/README.md b/trilhas_poo/vendor/composer/xdebug-handler/README.md
new file mode 100644
index 0000000..f7f581a
--- /dev/null
+++ b/trilhas_poo/vendor/composer/xdebug-handler/README.md
@@ -0,0 +1,305 @@
+# composer/xdebug-handler
+
+[](https://packagist.org/packages/composer/xdebug-handler)
+[](https://github.com/composer/xdebug-handler/actions?query=branch:main)
+
+
+
+Restart a CLI process without loading the Xdebug extension, unless `xdebug.mode=off`.
+
+Originally written as part of [composer/composer](https://github.com/composer/composer),
+now extracted and made available as a stand-alone library.
+
+### Version 3
+
+Removed support for legacy PHP versions and added type declarations.
+
+Long term support for version 2 (PHP 5.3.2 - 7.2.4) follows [Composer 2.2 LTS](https://blog.packagist.com/composer-2-2/) policy.
+
+## Installation
+
+Install the latest version with:
+
+```bash
+$ composer require composer/xdebug-handler
+```
+
+## Requirements
+
+* PHP 7.2.5 minimum, although using the latest PHP version is highly recommended.
+
+## Basic Usage
+```php
+use Composer\XdebugHandler\XdebugHandler;
+
+$xdebug = new XdebugHandler('myapp');
+$xdebug->check();
+unset($xdebug);
+```
+
+The constructor takes a single parameter, `$envPrefix`, which is upper-cased and prepended to default base values to create two distinct environment variables. The above example enables the use of:
+
+- `MYAPP_ALLOW_XDEBUG=1` to override automatic restart and allow Xdebug
+- `MYAPP_ORIGINAL_INIS` to obtain ini file locations in a restarted process
+
+## Advanced Usage
+
+* [How it works](#how-it-works)
+* [Limitations](#limitations)
+* [Helper methods](#helper-methods)
+* [Setter methods](#setter-methods)
+* [Process configuration](#process-configuration)
+* [Troubleshooting](#troubleshooting)
+* [Extending the library](#extending-the-library)
+* [Examples](#examples)
+
+### How it works
+
+A temporary ini file is created from the loaded (and scanned) ini files, with any references to the Xdebug extension commented out. Current ini settings are merged, so that most ini settings made on the command-line or by the application are included (see [Limitations](#limitations))
+
+* `MYAPP_ALLOW_XDEBUG` is set with internal data to flag and use in the restart.
+* The command-line and environment are [configured](#process-configuration) for the restart.
+* The application is restarted in a new process.
+ * The restart settings are stored in the environment.
+ * `MYAPP_ALLOW_XDEBUG` is unset.
+ * The application runs and exits.
+* The main process exits with the exit code from the restarted process.
+
+See [Examples](#examples) for further information.
+
+#### Signal handling
+Asynchronous signal handling is automatically enabled if the pcntl extension is loaded. `SIGINT` is set to `SIG_IGN` in the parent
+process and restored to `SIG_DFL` in the restarted process (if no other handler has been set).
+
+From PHP 7.4 on Windows, `CTRL+C` and `CTRL+BREAK` handling is automatically enabled in the restarted process and ignored in the parent process.
+
+### Limitations
+There are a few things to be aware of when running inside a restarted process.
+
+* Extensions set on the command-line will not be loaded.
+* Ini file locations will be reported as per the restart - see [getAllIniFiles()](#getallinifiles-array).
+* Php sub-processes may be loaded with Xdebug enabled - see [Process configuration](#process-configuration).
+
+### Helper methods
+These static methods provide information from the current process, regardless of whether it has been restarted or not.
+
+#### _getAllIniFiles(): array_
+Returns an array of the original ini file locations. Use this instead of calling `php_ini_loaded_file` and `php_ini_scanned_files`, which will report the wrong values in a restarted process.
+
+```php
+use Composer\XdebugHandler\XdebugHandler;
+
+$files = XdebugHandler::getAllIniFiles();
+
+# $files[0] always exists, it could be an empty string
+$loadedIni = array_shift($files);
+$scannedInis = $files;
+```
+
+These locations are also available in the `MYAPP_ORIGINAL_INIS` environment variable. This is a path-separated string comprising the location returned from `php_ini_loaded_file`, which could be empty, followed by locations parsed from calling `php_ini_scanned_files`.
+
+#### _getRestartSettings(): ?array_
+Returns an array of settings that can be used with PHP [sub-processes](#sub-processes), or null if the process was not restarted.
+
+```php
+use Composer\XdebugHandler\XdebugHandler;
+
+$settings = XdebugHandler::getRestartSettings();
+/**
+ * $settings: array (if the current process was restarted,
+ * or called with the settings from a previous restart), or null
+ *
+ * 'tmpIni' => the temporary ini file used in the restart (string)
+ * 'scannedInis' => if there were any scanned inis (bool)
+ * 'scanDir' => the original PHP_INI_SCAN_DIR value (false|string)
+ * 'phprc' => the original PHPRC value (false|string)
+ * 'inis' => the original inis from getAllIniFiles (array)
+ * 'skipped' => the skipped version from getSkippedVersion (string)
+ */
+```
+
+#### _getSkippedVersion(): string_
+Returns the Xdebug version string that was skipped by the restart, or an empty string if there was no restart (or Xdebug is still loaded, perhaps by an extending class restarting for a reason other than removing Xdebug).
+
+```php
+use Composer\XdebugHandler\XdebugHandler;
+
+$version = XdebugHandler::getSkippedVersion();
+# $version: '3.1.1' (for example), or an empty string
+```
+
+#### _isXdebugActive(): bool_
+Returns true if Xdebug is loaded and is running in an active mode (if it supports modes). Returns false if Xdebug is not loaded, or it is running with `xdebug.mode=off`.
+
+### Setter methods
+These methods implement a fluent interface and must be called before the main `check()` method.
+
+#### _setLogger(LoggerInterface $logger): self_
+Enables the output of status messages to an external PSR3 logger. All messages are reported with either `DEBUG` or `WARNING` log levels. For example (showing the level and message):
+
+```
+// No restart
+DEBUG Checking MYAPP_ALLOW_XDEBUG
+DEBUG The Xdebug extension is loaded (3.1.1) xdebug.mode=off
+DEBUG No restart (APP_ALLOW_XDEBUG=0) Allowed by xdebug.mode
+
+// Restart overridden
+DEBUG Checking MYAPP_ALLOW_XDEBUG
+DEBUG The Xdebug extension is loaded (3.1.1) xdebug.mode=coverage,debug,develop
+DEBUG No restart (MYAPP_ALLOW_XDEBUG=1)
+
+// Failed restart
+DEBUG Checking MYAPP_ALLOW_XDEBUG
+DEBUG The Xdebug extension is loaded (3.1.0)
+WARNING No restart (Unable to create temp ini file at: ...)
+```
+
+Status messages can also be output with `XDEBUG_HANDLER_DEBUG`. See [Troubleshooting](#troubleshooting).
+
+#### _setMainScript(string $script): self_
+Sets the location of the main script to run in the restart. This is only needed in more esoteric use-cases, or if the `argv[0]` location is inaccessible. The script name `--` is supported for standard input.
+
+#### _setPersistent(): self_
+Configures the restart using [persistent settings](#persistent-settings), so that Xdebug is not loaded in any sub-process.
+
+Use this method if your application invokes one or more PHP sub-process and the Xdebug extension is not needed. This avoids the overhead of implementing specific [sub-process](#sub-processes) strategies.
+
+Alternatively, this method can be used to set up a default _Xdebug-free_ environment which can be changed if a sub-process requires Xdebug, then restored afterwards:
+
+```php
+function SubProcessWithXdebug()
+{
+ $phpConfig = new Composer\XdebugHandler\PhpConfig();
+
+ # Set the environment to the original configuration
+ $phpConfig->useOriginal();
+
+ # run the process with Xdebug loaded
+ ...
+
+ # Restore Xdebug-free environment
+ $phpConfig->usePersistent();
+}
+```
+
+### Process configuration
+The library offers two strategies to invoke a new PHP process without loading Xdebug, using either _standard_ or _persistent_ settings. Note that this is only important if the application calls a PHP sub-process.
+
+#### Standard settings
+Uses command-line options to remove Xdebug from the new process only.
+
+* The -n option is added to the command-line. This tells PHP not to scan for additional inis.
+* The temporary ini is added to the command-line with the -c option.
+
+>_If the new process calls a PHP sub-process, Xdebug will be loaded in that sub-process (unless it implements xdebug-handler, in which case there will be another restart)._
+
+This is the default strategy used in the restart.
+
+#### Persistent settings
+Uses environment variables to remove Xdebug from the new process and persist these settings to any sub-process.
+
+* `PHP_INI_SCAN_DIR` is set to an empty string. This tells PHP not to scan for additional inis.
+* `PHPRC` is set to the temporary ini.
+
+>_If the new process calls a PHP sub-process, Xdebug will not be loaded in that sub-process._
+
+This strategy can be used in the restart by calling [setPersistent()](#setpersistent-self).
+
+#### Sub-processes
+The `PhpConfig` helper class makes it easy to invoke a PHP sub-process (with or without Xdebug loaded), regardless of whether there has been a restart.
+
+Each of its methods returns an array of PHP options (to add to the command-line) and sets up the environment for the required strategy. The [getRestartSettings()](#getrestartsettings-array) method is used internally.
+
+* `useOriginal()` - Xdebug will be loaded in the new process.
+* `useStandard()` - Xdebug will **not** be loaded in the new process - see [standard settings](#standard-settings).
+* `userPersistent()` - Xdebug will **not** be loaded in the new process - see [persistent settings](#persistent-settings)
+
+If there was no restart, an empty options array is returned and the environment is not changed.
+
+```php
+use Composer\XdebugHandler\PhpConfig;
+
+$config = new PhpConfig;
+
+$options = $config->useOriginal();
+# $options: empty array
+# environment: PHPRC and PHP_INI_SCAN_DIR set to original values
+
+$options = $config->useStandard();
+# $options: [-n, -c, tmpIni]
+# environment: PHPRC and PHP_INI_SCAN_DIR set to original values
+
+$options = $config->usePersistent();
+# $options: empty array
+# environment: PHPRC=tmpIni, PHP_INI_SCAN_DIR=''
+```
+
+### Troubleshooting
+The following environment settings can be used to troubleshoot unexpected behavior:
+
+* `XDEBUG_HANDLER_DEBUG=1` Outputs status messages to `STDERR`, if it is defined, irrespective of any PSR3 logger. Each message is prefixed `xdebug-handler[pid]`, where pid is the process identifier.
+
+* `XDEBUG_HANDLER_DEBUG=2` As above, but additionally saves the temporary ini file and reports its location in a status message.
+
+### Extending the library
+The API is defined by classes and their accessible elements that are not annotated as @internal. The main class has two protected methods that can be overridden to provide additional functionality:
+
+#### _requiresRestart(bool $default): bool_
+By default the process will restart if Xdebug is loaded and not running with `xdebug.mode=off`. Extending this method allows an application to decide, by returning a boolean (or equivalent) value.
+It is only called if `MYAPP_ALLOW_XDEBUG` is empty, so it will not be called in the restarted process (where this variable contains internal data), or if the restart has been overridden.
+
+Note that the [setMainScript()](#setmainscriptstring-script-self) and [setPersistent()](#setpersistent-self) setters can be used here, if required.
+
+#### _restart(array $command): void_
+An application can extend this to modify the temporary ini file, its location given in the `tmpIni` property. New settings can be safely appended to the end of the data, which is `PHP_EOL` terminated.
+
+The `$command` parameter is an array of unescaped command-line arguments that will be used for the new process.
+
+Remember to finish with `parent::restart($command)`.
+
+#### Example
+This example demonstrates two ways to extend basic functionality:
+
+* To avoid the overhead of spinning up a new process, the restart is skipped if a simple help command is requested.
+
+* The application needs write-access to phar files, so it will force a restart if `phar.readonly` is set (regardless of whether Xdebug is loaded) and change this value in the temporary ini file.
+
+```php
+use Composer\XdebugHandler\XdebugHandler;
+use MyApp\Command;
+
+class MyRestarter extends XdebugHandler
+{
+ private $required;
+
+ protected function requiresRestart(bool $default): bool
+ {
+ if (Command::isHelp()) {
+ # No need to disable Xdebug for this
+ return false;
+ }
+
+ $this->required = (bool) ini_get('phar.readonly');
+ return $this->required || $default;
+ }
+
+ protected function restart(array $command): void
+ {
+ if ($this->required) {
+ # Add required ini setting to tmpIni
+ $content = file_get_contents($this->tmpIni);
+ $content .= 'phar.readonly=0'.PHP_EOL;
+ file_put_contents($this->tmpIni, $content);
+ }
+
+ parent::restart($command);
+ }
+}
+```
+
+### Examples
+The `tests\App` directory contains command-line scripts that demonstrate the internal workings in a variety of scenarios.
+See [Functional Test Scripts](./tests/App/README.md).
+
+## License
+composer/xdebug-handler is licensed under the MIT License, see the LICENSE file for details.
diff --git a/trilhas_poo/vendor/composer/xdebug-handler/composer.json b/trilhas_poo/vendor/composer/xdebug-handler/composer.json
new file mode 100644
index 0000000..d205dc1
--- /dev/null
+++ b/trilhas_poo/vendor/composer/xdebug-handler/composer.json
@@ -0,0 +1,44 @@
+{
+ "name": "composer/xdebug-handler",
+ "description": "Restarts a process without Xdebug.",
+ "type": "library",
+ "license": "MIT",
+ "keywords": [
+ "xdebug",
+ "performance"
+ ],
+ "authors": [
+ {
+ "name": "John Stevenson",
+ "email": "john-stevenson@blueyonder.co.uk"
+ }
+ ],
+ "support": {
+ "irc": "ircs://irc.libera.chat:6697/composer",
+ "issues": "https://github.com/composer/xdebug-handler/issues"
+ },
+ "require": {
+ "php": "^7.2.5 || ^8.0",
+ "psr/log": "^1 || ^2 || ^3",
+ "composer/pcre": "^1 || ^2 || ^3"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.0",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5"
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\XdebugHandler\\": "src"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Composer\\XdebugHandler\\Tests\\": "tests"
+ }
+ },
+ "scripts": {
+ "test": "@php vendor/bin/phpunit",
+ "phpstan": "@php vendor/bin/phpstan analyse"
+ }
+}
diff --git a/trilhas_poo/vendor/composer/xdebug-handler/src/PhpConfig.php b/trilhas_poo/vendor/composer/xdebug-handler/src/PhpConfig.php
new file mode 100644
index 0000000..7edac88
--- /dev/null
+++ b/trilhas_poo/vendor/composer/xdebug-handler/src/PhpConfig.php
@@ -0,0 +1,91 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\XdebugHandler;
+
+/**
+ * @author John Stevenson
+ *
+ * @phpstan-type restartData array{tmpIni: string, scannedInis: bool, scanDir: false|string, phprc: false|string, inis: string[], skipped: string}
+ */
+class PhpConfig
+{
+ /**
+ * Use the original PHP configuration
+ *
+ * @return string[] Empty array of PHP cli options
+ */
+ public function useOriginal(): array
+ {
+ $this->getDataAndReset();
+ return [];
+ }
+
+ /**
+ * Use standard restart settings
+ *
+ * @return string[] PHP cli options
+ */
+ public function useStandard(): array
+ {
+ $data = $this->getDataAndReset();
+ if ($data !== null) {
+ return ['-n', '-c', $data['tmpIni']];
+ }
+
+ return [];
+ }
+
+ /**
+ * Use environment variables to persist settings
+ *
+ * @return string[] Empty array of PHP cli options
+ */
+ public function usePersistent(): array
+ {
+ $data = $this->getDataAndReset();
+ if ($data !== null) {
+ $this->updateEnv('PHPRC', $data['tmpIni']);
+ $this->updateEnv('PHP_INI_SCAN_DIR', '');
+ }
+
+ return [];
+ }
+
+ /**
+ * Returns restart data if available and resets the environment
+ *
+ * @phpstan-return restartData|null
+ */
+ private function getDataAndReset(): ?array
+ {
+ $data = XdebugHandler::getRestartSettings();
+ if ($data !== null) {
+ $this->updateEnv('PHPRC', $data['phprc']);
+ $this->updateEnv('PHP_INI_SCAN_DIR', $data['scanDir']);
+ }
+
+ return $data;
+ }
+
+ /**
+ * Updates a restart settings value in the environment
+ *
+ * @param string $name
+ * @param string|false $value
+ */
+ private function updateEnv(string $name, $value): void
+ {
+ Process::setEnv($name, false !== $value ? $value : null);
+ }
+}
diff --git a/trilhas_poo/vendor/composer/xdebug-handler/src/Process.php b/trilhas_poo/vendor/composer/xdebug-handler/src/Process.php
new file mode 100644
index 0000000..4e9f076
--- /dev/null
+++ b/trilhas_poo/vendor/composer/xdebug-handler/src/Process.php
@@ -0,0 +1,119 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Composer\XdebugHandler;
+
+use Composer\Pcre\Preg;
+
+/**
+ * Process utility functions
+ *
+ * @author John Stevenson
+ */
+class Process
+{
+ /**
+ * Escapes a string to be used as a shell argument.
+ *
+ * From https://github.com/johnstevenson/winbox-args
+ * MIT Licensed (c) John Stevenson
+ *
+ * @param string $arg The argument to be escaped
+ * @param bool $meta Additionally escape cmd.exe meta characters
+ * @param bool $module The argument is the module to invoke
+ */
+ public static function escape(string $arg, bool $meta = true, bool $module = false): string
+ {
+ if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
+ return "'".str_replace("'", "'\\''", $arg)."'";
+ }
+
+ $quote = strpbrk($arg, " \t") !== false || $arg === '';
+
+ $arg = Preg::replace('/(\\\\*)"/', '$1$1\\"', $arg, -1, $dquotes);
+ $dquotes = (bool) $dquotes;
+
+ if ($meta) {
+ $meta = $dquotes || Preg::isMatch('/%[^%]+%/', $arg);
+
+ if (!$meta) {
+ $quote = $quote || strpbrk($arg, '^&|<>()') !== false;
+ } elseif ($module && !$dquotes && $quote) {
+ $meta = false;
+ }
+ }
+
+ if ($quote) {
+ $arg = '"'.(Preg::replace('/(\\\\*)$/', '$1$1', $arg)).'"';
+ }
+
+ if ($meta) {
+ $arg = Preg::replace('/(["^&|<>()%])/', '^$1', $arg);
+ }
+
+ return $arg;
+ }
+
+ /**
+ * Escapes an array of arguments that make up a shell command
+ *
+ * @param string[] $args Argument list, with the module name first
+ */
+ public static function escapeShellCommand(array $args): string
+ {
+ $command = '';
+ $module = array_shift($args);
+
+ if ($module !== null) {
+ $command = self::escape($module, true, true);
+
+ foreach ($args as $arg) {
+ $command .= ' '.self::escape($arg);
+ }
+ }
+
+ return $command;
+ }
+
+ /**
+ * Makes putenv environment changes available in $_SERVER and $_ENV
+ *
+ * @param string $name
+ * @param ?string $value A null value unsets the variable
+ */
+ public static function setEnv(string $name, ?string $value = null): bool
+ {
+ $unset = null === $value;
+
+ if (!putenv($unset ? $name : $name.'='.$value)) {
+ return false;
+ }
+
+ if ($unset) {
+ unset($_SERVER[$name]);
+ } else {
+ $_SERVER[$name] = $value;
+ }
+
+ // Update $_ENV if it is being used
+ if (false !== stripos((string) ini_get('variables_order'), 'E')) {
+ if ($unset) {
+ unset($_ENV[$name]);
+ } else {
+ $_ENV[$name] = $value;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/trilhas_poo/vendor/composer/xdebug-handler/src/Status.php b/trilhas_poo/vendor/composer/xdebug-handler/src/Status.php
new file mode 100644
index 0000000..96c5944
--- /dev/null
+++ b/trilhas_poo/vendor/composer/xdebug-handler/src/Status.php
@@ -0,0 +1,222 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Composer\XdebugHandler;
+
+use Psr\Log\LoggerInterface;
+use Psr\Log\LogLevel;
+
+/**
+ * @author John Stevenson
+ * @internal
+ */
+class Status
+{
+ const ENV_RESTART = 'XDEBUG_HANDLER_RESTART';
+ const CHECK = 'Check';
+ const ERROR = 'Error';
+ const INFO = 'Info';
+ const NORESTART = 'NoRestart';
+ const RESTART = 'Restart';
+ const RESTARTING = 'Restarting';
+ const RESTARTED = 'Restarted';
+
+ /** @var bool */
+ private $debug;
+
+ /** @var string */
+ private $envAllowXdebug;
+
+ /** @var string|null */
+ private $loaded;
+
+ /** @var LoggerInterface|null */
+ private $logger;
+
+ /** @var bool */
+ private $modeOff;
+
+ /** @var float */
+ private $time;
+
+ /**
+ * @param string $envAllowXdebug Prefixed _ALLOW_XDEBUG name
+ * @param bool $debug Whether debug output is required
+ */
+ public function __construct(string $envAllowXdebug, bool $debug)
+ {
+ $start = getenv(self::ENV_RESTART);
+ Process::setEnv(self::ENV_RESTART);
+ $this->time = is_numeric($start) ? round((microtime(true) - $start) * 1000) : 0;
+
+ $this->envAllowXdebug = $envAllowXdebug;
+ $this->debug = $debug && defined('STDERR');
+ $this->modeOff = false;
+ }
+
+ /**
+ * Activates status message output to a PSR3 logger
+ *
+ * @return void
+ */
+ public function setLogger(LoggerInterface $logger): void
+ {
+ $this->logger = $logger;
+ }
+
+ /**
+ * Calls a handler method to report a message
+ *
+ * @throws \InvalidArgumentException If $op is not known
+ */
+ public function report(string $op, ?string $data): void
+ {
+ if ($this->logger !== null || $this->debug) {
+ $param = (string) $data;
+
+ switch($op) {
+ case self::CHECK:
+ $this->reportCheck($param);
+ break;
+ case self::ERROR:
+ $this->reportError($param);
+ break;
+ case self::INFO:
+ $this->reportInfo($param);
+ break;
+ case self::NORESTART:
+ $this->reportNoRestart();
+ break;
+ case self::RESTART:
+ $this->reportRestart();
+ break;
+ case self::RESTARTED:
+ $this->reportRestarted();
+ break;
+ case self::RESTARTING:
+ $this->reportRestarting($param);
+ break;
+ default:
+ throw new \InvalidArgumentException('Unknown op handler: '.$op);
+ }
+ }
+ }
+
+ /**
+ * Outputs a status message
+ */
+ private function output(string $text, ?string $level = null): void
+ {
+ if ($this->logger !== null) {
+ $this->logger->log($level !== null ? $level: LogLevel::DEBUG, $text);
+ }
+
+ if ($this->debug) {
+ fwrite(STDERR, sprintf('xdebug-handler[%d] %s', getmypid(), $text.PHP_EOL));
+ }
+ }
+
+ /**
+ * Checking status message
+ */
+ private function reportCheck(string $loaded): void
+ {
+ list($version, $mode) = explode('|', $loaded);
+
+ if ($version !== '') {
+ $this->loaded = '('.$version.')'.($mode !== '' ? ' xdebug.mode='.$mode : '');
+ }
+ $this->modeOff = $mode === 'off';
+ $this->output('Checking '.$this->envAllowXdebug);
+ }
+
+ /**
+ * Error status message
+ */
+ private function reportError(string $error): void
+ {
+ $this->output(sprintf('No restart (%s)', $error), LogLevel::WARNING);
+ }
+
+ /**
+ * Info status message
+ */
+ private function reportInfo(string $info): void
+ {
+ $this->output($info);
+ }
+
+ /**
+ * No restart status message
+ */
+ private function reportNoRestart(): void
+ {
+ $this->output($this->getLoadedMessage());
+
+ if ($this->loaded !== null) {
+ $text = sprintf('No restart (%s)', $this->getEnvAllow());
+ if (!((bool) getenv($this->envAllowXdebug))) {
+ $text .= ' Allowed by '.($this->modeOff ? 'xdebug.mode' : 'application');
+ }
+ $this->output($text);
+ }
+ }
+
+ /**
+ * Restart status message
+ */
+ private function reportRestart(): void
+ {
+ $this->output($this->getLoadedMessage());
+ Process::setEnv(self::ENV_RESTART, (string) microtime(true));
+ }
+
+ /**
+ * Restarted status message
+ */
+ private function reportRestarted(): void
+ {
+ $loaded = $this->getLoadedMessage();
+ $text = sprintf('Restarted (%d ms). %s', $this->time, $loaded);
+ $level = $this->loaded !== null ? LogLevel::WARNING : null;
+ $this->output($text, $level);
+ }
+
+ /**
+ * Restarting status message
+ */
+ private function reportRestarting(string $command): void
+ {
+ $text = sprintf('Process restarting (%s)', $this->getEnvAllow());
+ $this->output($text);
+ $text = 'Running: '.$command;
+ $this->output($text);
+ }
+
+ /**
+ * Returns the _ALLOW_XDEBUG environment variable as name=value
+ */
+ private function getEnvAllow(): string
+ {
+ return $this->envAllowXdebug.'='.getenv($this->envAllowXdebug);
+ }
+
+ /**
+ * Returns the Xdebug status and version
+ */
+ private function getLoadedMessage(): string
+ {
+ $loaded = $this->loaded !== null ? sprintf('loaded %s', $this->loaded) : 'not loaded';
+ return 'The Xdebug extension is '.$loaded;
+ }
+}
diff --git a/trilhas_poo/vendor/composer/xdebug-handler/src/XdebugHandler.php b/trilhas_poo/vendor/composer/xdebug-handler/src/XdebugHandler.php
new file mode 100644
index 0000000..a665939
--- /dev/null
+++ b/trilhas_poo/vendor/composer/xdebug-handler/src/XdebugHandler.php
@@ -0,0 +1,722 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Composer\XdebugHandler;
+
+use Composer\Pcre\Preg;
+use Psr\Log\LoggerInterface;
+
+/**
+ * @author John Stevenson
+ *
+ * @phpstan-import-type restartData from PhpConfig
+ */
+class XdebugHandler
+{
+ const SUFFIX_ALLOW = '_ALLOW_XDEBUG';
+ const SUFFIX_INIS = '_ORIGINAL_INIS';
+ const RESTART_ID = 'internal';
+ const RESTART_SETTINGS = 'XDEBUG_HANDLER_SETTINGS';
+ const DEBUG = 'XDEBUG_HANDLER_DEBUG';
+
+ /** @var string|null */
+ protected $tmpIni;
+
+ /** @var bool */
+ private static $inRestart;
+
+ /** @var string */
+ private static $name;
+
+ /** @var string|null */
+ private static $skipped;
+
+ /** @var bool */
+ private static $xdebugActive;
+
+ /** @var string|null */
+ private static $xdebugMode;
+
+ /** @var string|null */
+ private static $xdebugVersion;
+
+ /** @var bool */
+ private $cli;
+
+ /** @var string|null */
+ private $debug;
+
+ /** @var string */
+ private $envAllowXdebug;
+
+ /** @var string */
+ private $envOriginalInis;
+
+ /** @var bool */
+ private $persistent;
+
+ /** @var string|null */
+ private $script;
+
+ /** @var Status */
+ private $statusWriter;
+
+ /**
+ * Constructor
+ *
+ * The $envPrefix is used to create distinct environment variables. It is
+ * uppercased and prepended to the default base values. For example 'myapp'
+ * would result in MYAPP_ALLOW_XDEBUG and MYAPP_ORIGINAL_INIS.
+ *
+ * @param string $envPrefix Value used in environment variables
+ * @throws \RuntimeException If the parameter is invalid
+ */
+ public function __construct(string $envPrefix)
+ {
+ if ($envPrefix === '') {
+ throw new \RuntimeException('Invalid constructor parameter');
+ }
+
+ self::$name = strtoupper($envPrefix);
+ $this->envAllowXdebug = self::$name.self::SUFFIX_ALLOW;
+ $this->envOriginalInis = self::$name.self::SUFFIX_INIS;
+
+ self::setXdebugDetails();
+ self::$inRestart = false;
+
+ if ($this->cli = PHP_SAPI === 'cli') {
+ $this->debug = (string) getenv(self::DEBUG);
+ }
+
+ $this->statusWriter = new Status($this->envAllowXdebug, (bool) $this->debug);
+ }
+
+ /**
+ * Activates status message output to a PSR3 logger
+ */
+ public function setLogger(LoggerInterface $logger): self
+ {
+ $this->statusWriter->setLogger($logger);
+ return $this;
+ }
+
+ /**
+ * Sets the main script location if it cannot be called from argv
+ */
+ public function setMainScript(string $script): self
+ {
+ $this->script = $script;
+ return $this;
+ }
+
+ /**
+ * Persist the settings to keep Xdebug out of sub-processes
+ */
+ public function setPersistent(): self
+ {
+ $this->persistent = true;
+ return $this;
+ }
+
+ /**
+ * Checks if Xdebug is loaded and the process needs to be restarted
+ *
+ * This behaviour can be disabled by setting the MYAPP_ALLOW_XDEBUG
+ * environment variable to 1. This variable is used internally so that
+ * the restarted process is created only once.
+ */
+ public function check(): void
+ {
+ $this->notify(Status::CHECK, self::$xdebugVersion.'|'.self::$xdebugMode);
+ $envArgs = explode('|', (string) getenv($this->envAllowXdebug));
+
+ if (!((bool) $envArgs[0]) && $this->requiresRestart(self::$xdebugActive)) {
+ // Restart required
+ $this->notify(Status::RESTART);
+ $command = $this->prepareRestart();
+
+ if ($command !== null) {
+ $this->restart($command);
+ }
+ return;
+ }
+
+ if (self::RESTART_ID === $envArgs[0] && count($envArgs) === 5) {
+ // Restarted, so unset environment variable and use saved values
+ $this->notify(Status::RESTARTED);
+
+ Process::setEnv($this->envAllowXdebug);
+ self::$inRestart = true;
+
+ if (self::$xdebugVersion === null) {
+ // Skipped version is only set if Xdebug is not loaded
+ self::$skipped = $envArgs[1];
+ }
+
+ $this->tryEnableSignals();
+
+ // Put restart settings in the environment
+ $this->setEnvRestartSettings($envArgs);
+ return;
+ }
+
+ $this->notify(Status::NORESTART);
+ $settings = self::getRestartSettings();
+
+ if ($settings !== null) {
+ // Called with existing settings, so sync our settings
+ $this->syncSettings($settings);
+ }
+ }
+
+ /**
+ * Returns an array of php.ini locations with at least one entry
+ *
+ * The equivalent of calling php_ini_loaded_file then php_ini_scanned_files.
+ * The loaded ini location is the first entry and may be an empty string.
+ *
+ * @return non-empty-list
+ */
+ public static function getAllIniFiles(): array
+ {
+ if (self::$name !== null) {
+ $env = getenv(self::$name.self::SUFFIX_INIS);
+
+ if (false !== $env) {
+ return explode(PATH_SEPARATOR, $env);
+ }
+ }
+
+ $paths = [(string) php_ini_loaded_file()];
+ $scanned = php_ini_scanned_files();
+
+ if ($scanned !== false) {
+ $paths = array_merge($paths, array_map('trim', explode(',', $scanned)));
+ }
+
+ return $paths;
+ }
+
+ /**
+ * Returns an array of restart settings or null
+ *
+ * Settings will be available if the current process was restarted, or
+ * called with the settings from an existing restart.
+ *
+ * @phpstan-return restartData|null
+ */
+ public static function getRestartSettings(): ?array
+ {
+ $envArgs = explode('|', (string) getenv(self::RESTART_SETTINGS));
+
+ if (count($envArgs) !== 6
+ || (!self::$inRestart && php_ini_loaded_file() !== $envArgs[0])) {
+ return null;
+ }
+
+ return [
+ 'tmpIni' => $envArgs[0],
+ 'scannedInis' => (bool) $envArgs[1],
+ 'scanDir' => '*' === $envArgs[2] ? false : $envArgs[2],
+ 'phprc' => '*' === $envArgs[3] ? false : $envArgs[3],
+ 'inis' => explode(PATH_SEPARATOR, $envArgs[4]),
+ 'skipped' => $envArgs[5],
+ ];
+ }
+
+ /**
+ * Returns the Xdebug version that triggered a successful restart
+ */
+ public static function getSkippedVersion(): string
+ {
+ return (string) self::$skipped;
+ }
+
+ /**
+ * Returns whether Xdebug is loaded and active
+ *
+ * true: if Xdebug is loaded and is running in an active mode.
+ * false: if Xdebug is not loaded, or it is running with xdebug.mode=off.
+ */
+ public static function isXdebugActive(): bool
+ {
+ self::setXdebugDetails();
+ return self::$xdebugActive;
+ }
+
+ /**
+ * Allows an extending class to decide if there should be a restart
+ *
+ * The default is to restart if Xdebug is loaded and its mode is not "off".
+ */
+ protected function requiresRestart(bool $default): bool
+ {
+ return $default;
+ }
+
+ /**
+ * Allows an extending class to access the tmpIni
+ *
+ * @param non-empty-list $command
+ */
+ protected function restart(array $command): void
+ {
+ $this->doRestart($command);
+ }
+
+ /**
+ * Executes the restarted command then deletes the tmp ini
+ *
+ * @param non-empty-list $command
+ * @phpstan-return never
+ */
+ private function doRestart(array $command): void
+ {
+ if (PHP_VERSION_ID >= 70400) {
+ $cmd = $command;
+ $displayCmd = sprintf('[%s]', implode(', ', $cmd));
+ } else {
+ $cmd = Process::escapeShellCommand($command);
+ if (defined('PHP_WINDOWS_VERSION_BUILD')) {
+ // Outer quotes required on cmd string below PHP 8
+ $cmd = '"'.$cmd.'"';
+ }
+ $displayCmd = $cmd;
+ }
+
+ $this->tryEnableSignals();
+ $this->notify(Status::RESTARTING, $displayCmd);
+
+ $process = proc_open($cmd, [], $pipes);
+ if (is_resource($process)) {
+ $exitCode = proc_close($process);
+ }
+
+ if (!isset($exitCode)) {
+ // Unlikely that php or the default shell cannot be invoked
+ $this->notify(Status::ERROR, 'Unable to restart process');
+ $exitCode = -1;
+ } else {
+ $this->notify(Status::INFO, 'Restarted process exited '.$exitCode);
+ }
+
+ if ($this->debug === '2') {
+ $this->notify(Status::INFO, 'Temp ini saved: '.$this->tmpIni);
+ } else {
+ @unlink((string) $this->tmpIni);
+ }
+
+ exit($exitCode);
+ }
+
+ /**
+ * Returns the command line array if everything was written for the restart
+ *
+ * If any of the following fails (however unlikely) we must return false to
+ * stop potential recursion:
+ * - tmp ini file creation
+ * - environment variable creation
+ *
+ * @return non-empty-list|null
+ */
+ private function prepareRestart(): ?array
+ {
+ if (!$this->cli) {
+ $this->notify(Status::ERROR, 'Unsupported SAPI: '.PHP_SAPI);
+ return null;
+ }
+
+ if (($argv = $this->checkServerArgv()) === null) {
+ $this->notify(Status::ERROR, '$_SERVER[argv] is not as expected');
+ return null;
+ }
+
+ if (!$this->checkConfiguration($info)) {
+ $this->notify(Status::ERROR, $info);
+ return null;
+ }
+
+ $mainScript = (string) $this->script;
+ if (!$this->checkMainScript($mainScript, $argv)) {
+ $this->notify(Status::ERROR, 'Unable to access main script: '.$mainScript);
+ return null;
+ }
+
+ $tmpDir = sys_get_temp_dir();
+ $iniError = 'Unable to create temp ini file at: '.$tmpDir;
+
+ if (($tmpfile = @tempnam($tmpDir, '')) === false) {
+ $this->notify(Status::ERROR, $iniError);
+ return null;
+ }
+
+ $error = null;
+ $iniFiles = self::getAllIniFiles();
+ $scannedInis = count($iniFiles) > 1;
+
+ if (!$this->writeTmpIni($tmpfile, $iniFiles, $error)) {
+ $this->notify(Status::ERROR, $error ?? $iniError);
+ @unlink($tmpfile);
+ return null;
+ }
+
+ if (!$this->setEnvironment($scannedInis, $iniFiles, $tmpfile)) {
+ $this->notify(Status::ERROR, 'Unable to set environment variables');
+ @unlink($tmpfile);
+ return null;
+ }
+
+ $this->tmpIni = $tmpfile;
+
+ return $this->getCommand($argv, $tmpfile, $mainScript);
+ }
+
+ /**
+ * Returns true if the tmp ini file was written
+ *
+ * @param non-empty-list $iniFiles All ini files used in the current process
+ */
+ private function writeTmpIni(string $tmpFile, array $iniFiles, ?string &$error): bool
+ {
+ // $iniFiles has at least one item and it may be empty
+ if ($iniFiles[0] === '') {
+ array_shift($iniFiles);
+ }
+
+ $content = '';
+ $sectionRegex = '/^\s*\[(?:PATH|HOST)\s*=/mi';
+ $xdebugRegex = '/^\s*(zend_extension\s*=.*xdebug.*)$/mi';
+
+ foreach ($iniFiles as $file) {
+ // Check for inaccessible ini files
+ if (($data = @file_get_contents($file)) === false) {
+ $error = 'Unable to read ini: '.$file;
+ return false;
+ }
+ // Check and remove directives after HOST and PATH sections
+ if (Preg::isMatchWithOffsets($sectionRegex, $data, $matches)) {
+ $data = substr($data, 0, $matches[0][1]);
+ }
+ $content .= Preg::replace($xdebugRegex, ';$1', $data).PHP_EOL;
+ }
+
+ // Merge loaded settings into our ini content, if it is valid
+ $config = parse_ini_string($content);
+ $loaded = ini_get_all(null, false);
+
+ if (false === $config || false === $loaded) {
+ $error = 'Unable to parse ini data';
+ return false;
+ }
+
+ $content .= $this->mergeLoadedConfig($loaded, $config);
+
+ // Work-around for https://bugs.php.net/bug.php?id=75932
+ $content .= 'opcache.enable_cli=0'.PHP_EOL;
+
+ return (bool) @file_put_contents($tmpFile, $content);
+ }
+
+ /**
+ * Returns the command line arguments for the restart
+ *
+ * @param non-empty-list $argv
+ * @return non-empty-list
+ */
+ private function getCommand(array $argv, string $tmpIni, string $mainScript): array
+ {
+ $php = [PHP_BINARY];
+ $args = array_slice($argv, 1);
+
+ if (!$this->persistent) {
+ // Use command-line options
+ array_push($php, '-n', '-c', $tmpIni);
+ }
+
+ return array_merge($php, [$mainScript], $args);
+ }
+
+ /**
+ * Returns true if the restart environment variables were set
+ *
+ * No need to update $_SERVER since this is set in the restarted process.
+ *
+ * @param non-empty-list $iniFiles All ini files used in the current process
+ */
+ private function setEnvironment(bool $scannedInis, array $iniFiles, string $tmpIni): bool
+ {
+ $scanDir = getenv('PHP_INI_SCAN_DIR');
+ $phprc = getenv('PHPRC');
+
+ // Make original inis available to restarted process
+ if (!putenv($this->envOriginalInis.'='.implode(PATH_SEPARATOR, $iniFiles))) {
+ return false;
+ }
+
+ if ($this->persistent) {
+ // Use the environment to persist the settings
+ if (!putenv('PHP_INI_SCAN_DIR=') || !putenv('PHPRC='.$tmpIni)) {
+ return false;
+ }
+ }
+
+ // Flag restarted process and save values for it to use
+ $envArgs = [
+ self::RESTART_ID,
+ self::$xdebugVersion,
+ (int) $scannedInis,
+ false === $scanDir ? '*' : $scanDir,
+ false === $phprc ? '*' : $phprc,
+ ];
+
+ return putenv($this->envAllowXdebug.'='.implode('|', $envArgs));
+ }
+
+ /**
+ * Logs status messages
+ */
+ private function notify(string $op, ?string $data = null): void
+ {
+ $this->statusWriter->report($op, $data);
+ }
+
+ /**
+ * Returns default, changed and command-line ini settings
+ *
+ * @param mixed[] $loadedConfig All current ini settings
+ * @param mixed[] $iniConfig Settings from user ini files
+ *
+ */
+ private function mergeLoadedConfig(array $loadedConfig, array $iniConfig): string
+ {
+ $content = '';
+
+ foreach ($loadedConfig as $name => $value) {
+ // Value will either be null, string or array (HHVM only)
+ if (!is_string($value)
+ || strpos($name, 'xdebug') === 0
+ || $name === 'apc.mmap_file_mask') {
+ continue;
+ }
+
+ if (!isset($iniConfig[$name]) || $iniConfig[$name] !== $value) {
+ // Double-quote escape each value
+ $content .= $name.'="'.addcslashes($value, '\\"').'"'.PHP_EOL;
+ }
+ }
+
+ return $content;
+ }
+
+ /**
+ * Returns true if the script name can be used
+ *
+ * @param non-empty-list $argv
+ */
+ private function checkMainScript(string &$mainScript, array $argv): bool
+ {
+ if ($mainScript !== '') {
+ // Allow an application to set -- for standard input
+ return file_exists($mainScript) || '--' === $mainScript;
+ }
+
+ if (file_exists($mainScript = $argv[0])) {
+ return true;
+ }
+
+ // Use a backtrace to resolve Phar and chdir issues.
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
+ $main = end($trace);
+
+ if ($main !== false && isset($main['file'])) {
+ return file_exists($mainScript = $main['file']);
+ }
+
+ return false;
+ }
+
+ /**
+ * Adds restart settings to the environment
+ *
+ * @param non-empty-list $envArgs
+ */
+ private function setEnvRestartSettings(array $envArgs): void
+ {
+ $settings = [
+ php_ini_loaded_file(),
+ $envArgs[2],
+ $envArgs[3],
+ $envArgs[4],
+ getenv($this->envOriginalInis),
+ self::$skipped,
+ ];
+
+ Process::setEnv(self::RESTART_SETTINGS, implode('|', $settings));
+ }
+
+ /**
+ * Syncs settings and the environment if called with existing settings
+ *
+ * @phpstan-param restartData $settings
+ */
+ private function syncSettings(array $settings): void
+ {
+ if (false === getenv($this->envOriginalInis)) {
+ // Called by another app, so make original inis available
+ Process::setEnv($this->envOriginalInis, implode(PATH_SEPARATOR, $settings['inis']));
+ }
+
+ self::$skipped = $settings['skipped'];
+ $this->notify(Status::INFO, 'Process called with existing restart settings');
+ }
+
+ /**
+ * Returns true if there are no known configuration issues
+ */
+ private function checkConfiguration(?string &$info): bool
+ {
+ if (!function_exists('proc_open')) {
+ $info = 'proc_open function is disabled';
+ return false;
+ }
+
+ if (!file_exists(PHP_BINARY)) {
+ $info = 'PHP_BINARY is not available';
+ return false;
+ }
+
+ if (extension_loaded('uopz') && !((bool) ini_get('uopz.disable'))) {
+ // uopz works at opcode level and disables exit calls
+ if (function_exists('uopz_allow_exit')) {
+ @uopz_allow_exit(true);
+ } else {
+ $info = 'uopz extension is not compatible';
+ return false;
+ }
+ }
+
+ // Check UNC paths when using cmd.exe
+ if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 70400) {
+ $workingDir = getcwd();
+
+ if ($workingDir === false) {
+ $info = 'unable to determine working directory';
+ return false;
+ }
+
+ if (0 === strpos($workingDir, '\\\\')) {
+ $info = 'cmd.exe does not support UNC paths: '.$workingDir;
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Enables async signals and control interrupts in the restarted process
+ *
+ * Available on Unix PHP 7.1+ with the pcntl extension and Windows PHP 7.4+.
+ */
+ private function tryEnableSignals(): void
+ {
+ if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {
+ pcntl_async_signals(true);
+ $message = 'Async signals enabled';
+
+ if (!self::$inRestart) {
+ // Restarting, so ignore SIGINT in parent
+ pcntl_signal(SIGINT, SIG_IGN);
+ } elseif (is_int(pcntl_signal_get_handler(SIGINT))) {
+ // Restarted, no handler set so force default action
+ pcntl_signal(SIGINT, SIG_DFL);
+ }
+ }
+
+ if (!self::$inRestart && function_exists('sapi_windows_set_ctrl_handler')) {
+ // Restarting, so set a handler to ignore CTRL events in the parent.
+ // This ensures that CTRL+C events will be available in the child
+ // process without having to enable them there, which is unreliable.
+ sapi_windows_set_ctrl_handler(function ($evt) {});
+ }
+ }
+
+ /**
+ * Returns $_SERVER['argv'] if it is as expected
+ *
+ * @return non-empty-list|null
+ */
+ private function checkServerArgv(): ?array
+ {
+ $result = [];
+
+ if (isset($_SERVER['argv']) && is_array($_SERVER['argv'])) {
+ foreach ($_SERVER['argv'] as $value) {
+ if (!is_string($value)) {
+ return null;
+ }
+
+ $result[] = $value;
+ }
+ }
+
+ return count($result) > 0 ? $result : null;
+ }
+
+ /**
+ * Sets static properties $xdebugActive, $xdebugVersion and $xdebugMode
+ */
+ private static function setXdebugDetails(): void
+ {
+ if (self::$xdebugActive !== null) {
+ return;
+ }
+
+ self::$xdebugActive = false;
+ if (!extension_loaded('xdebug')) {
+ return;
+ }
+
+ $version = phpversion('xdebug');
+ self::$xdebugVersion = $version !== false ? $version : 'unknown';
+
+ if (version_compare(self::$xdebugVersion, '3.1', '>=')) {
+ $modes = xdebug_info('mode');
+ self::$xdebugMode = count($modes) === 0 ? 'off' : implode(',', $modes);
+ self::$xdebugActive = self::$xdebugMode !== 'off';
+ return;
+ }
+
+ // See if xdebug.mode is supported in this version
+ $iniMode = ini_get('xdebug.mode');
+ if ($iniMode === false) {
+ self::$xdebugActive = true;
+ return;
+ }
+
+ // Environment value wins but cannot be empty
+ $envMode = (string) getenv('XDEBUG_MODE');
+ if ($envMode !== '') {
+ self::$xdebugMode = $envMode;
+ } else {
+ self::$xdebugMode = $iniMode !== '' ? $iniMode : 'off';
+ }
+
+ // An empty comma-separated list is treated as mode 'off'
+ if (Preg::isMatch('/^,+$/', str_replace(' ', '', self::$xdebugMode))) {
+ self::$xdebugMode = 'off';
+ }
+
+ self::$xdebugActive = self::$xdebugMode !== 'off';
+ }
+}
diff --git a/trilhas_poo/vendor/ergebnis/agent-detector/CHANGELOG.md b/trilhas_poo/vendor/ergebnis/agent-detector/CHANGELOG.md
new file mode 100644
index 0000000..26d6bcb
--- /dev/null
+++ b/trilhas_poo/vendor/ergebnis/agent-detector/CHANGELOG.md
@@ -0,0 +1,60 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## Unreleased
+
+For a full diff see [`1.2.0...main`][1.2.0...main].
+
+## [`1.2.0`][1.2.0]
+
+For a full diff see [`1.1.1...1.2.0`][1.1.1...1.2.0].
+
+### Added
+
+- Added support for detecting the presence of an agent when the `COPILOT_CLI` or `PI_CODING_AGENT` environment variables are set ([#10]), by [@raphaelstolt]
+
+## [`1.1.1`][1.1.1]
+
+For a full diff see [`1.1.0...1.1.1`][1.1.0...1.1.1].
+
+### Fixed
+
+- Allowed installation on PHP 8.6 ([#4]), by [@localheinz]
+
+## [`1.1.0`][1.1.0]
+
+For a full diff see [`1.0.1...1.1.0`][1.0.1...1.1.0].
+
+### Added
+
+- Added support for detecting the presence of an agent when the `CURSOR_EXTENSION_HOST_ROLE` environment variable is set ([#2]), by [@localheinz]
+
+## [`1.0.1`][1.0.1]
+
+For a full diff see [`2655ea1...1.0.1`][2655ea1...1.0.1].
+
+### Added
+
+- Added `Detector` ([#1]), by [@localheinz]
+
+[1.0.1]: https://github.com/ergebnis/agent-detector/releases/tag/1.0.1
+[1.1.0]: https://github.com/ergebnis/agent-detector/releases/tag/1.1.0
+[1.1.1]: https://github.com/ergebnis/agent-detector/releases/tag/1.1.1
+[1.2.0]: https://github.com/ergebnis/agent-detector/releases/tag/1.2.0
+
+[2655ea1...1.0.1]: https://github.com/ergebnis/agent-detector/compare/2655ea1...1.0.1
+[1.0.1...1.1.0]: https://github.com/ergebnis/agent-detector/compare/1.0.1...1.1.0
+[1.1.0...1.1.1]: https://github.com/ergebnis/agent-detector/compare/1.1.0...1.1.1
+[1.1.1...1.2.0]: https://github.com/ergebnis/agent-detector/compare/1.1.1...1.2.0
+[1.2.0...main]: https://github.com/ergebnis/agent-detector/compare/1.2.0...main
+
+[#1]: https://github.com/ergebnis/agent-detector/pull/1
+[#2]: https://github.com/ergebnis/agent-detector/pull/2
+[#4]: https://github.com/ergebnis/agent-detector/pull/4
+[#10]: https://github.com/ergebnis/agent-detector/pull/10
+
+[@localheinz]: https://github.com/localheinz
+[@raphaelstolt]: https://github.com/raphaelstolt
diff --git a/trilhas_poo/vendor/ergebnis/agent-detector/LICENSE.md b/trilhas_poo/vendor/ergebnis/agent-detector/LICENSE.md
new file mode 100644
index 0000000..bb32be1
--- /dev/null
+++ b/trilhas_poo/vendor/ergebnis/agent-detector/LICENSE.md
@@ -0,0 +1,16 @@
+# The MIT License (MIT)
+
+Copyright (c) 2026 Andreas Möller
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+documentation files (the _Software_), to deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED **AS IS**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/trilhas_poo/vendor/ergebnis/agent-detector/README.md b/trilhas_poo/vendor/ergebnis/agent-detector/README.md
new file mode 100644
index 0000000..c73d391
--- /dev/null
+++ b/trilhas_poo/vendor/ergebnis/agent-detector/README.md
@@ -0,0 +1,107 @@
+# agent-detector
+
+[](https://github.com/ergebnis/agent-detector/actions/workflows/integrate.yaml)
+[](https://github.com/ergebnis/agent-detector/actions/workflows/merge.yaml)
+[](https://github.com/ergebnis/agent-detector/actions/workflows/release.yaml)
+[](https://github.com/ergebnis/agent-detector/actions/workflows/renew.yaml)
+
+[](https://codecov.io/gh/ergebnis/agent-detector)
+
+[](https://packagist.org/packages/ergebnis/agent-detector)
+[](https://packagist.org/packages/ergebnis/agent-detector)
+[](https://packagist.org/packages/ergebnis/agent-detector)
+
+This project provides a [`composer`](https://getcomposer.org) package with a detector for detecting the presence of an agent.
+
+## Installation
+
+Run
+
+```sh
+composer require ergebnis/agent-detector
+```
+
+## Usage
+
+### Detecting the presence of an agent
+
+```php
+isAgentPresent(\getenv());
+```
+
+### Supported agents
+
+This package detects the presence of the following agents via environment variables:
+
+| Agent | Environment Variable |
+|---|---|
+| [Amp](https://amp.dev) | `AMP_CURRENT_THREAD_ID` |
+| [Antigravity](https://antigravity.dev) | `ANTIGRAVITY_AGENT` |
+| [Augment](https://augmentcode.com) | `AUGMENT_AGENT` |
+| [Claude Code](https://github.com/anthropics/claude-code) | `CLAUDECODE`, `CLAUDE_CODE`, `CLAUDE_CODE_IS_COWORK` |
+| [Codex](https://github.com/openai/codex) | `CODEX_CI`, `CODEX_SANDBOX`, `CODEX_THREAD_ID` |
+| [Cursor](https://cursor.com) | `CURSOR_AGENT`, `CURSOR_EXTENSION_HOST_ROLE`, `CURSOR_TRACE_ID` |
+| [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `GEMINI_CLI` |
+| [GitHub Copilot](https://github.com/features/copilot) | `COPILOT_ALLOW_ALL`, `COPILOT_CLI`, `COPILOT_GITHUB_TOKEN`, `COPILOT_MODEL |
+| [OpenCode](https://github.com/sst/opencode) | `OPENCODE`, `OPENCODE_CLIENT` |
+| [Pi](https://pi.dev) | `PI_CODING_AGENT` |
+| [Replit](https://replit.com) | `REPL_ID` |
+
+### Indicating the presence of an agent
+
+In addition, the generic `AI_AGENT` environment variable can be set to indicate the presence of an agent.
+
+## Changelog
+
+The maintainers of this project record notable changes to this project in a [changelog](CHANGELOG.md).
+
+## Contributing
+
+The maintainers of this project suggest following the [contribution guide](.github/CONTRIBUTING.md).
+
+## Code of Conduct
+
+The maintainers of this project ask contributors to follow the [code of conduct](https://github.com/ergebnis/.github/blob/main/CODE_OF_CONDUCT.md).
+
+## General Support Policy
+
+The maintainers of this project provide limited support.
+
+## PHP Version Support Policy
+
+This project currently supports the following PHP versions:
+
+- [PHP 7.4](https://www.php.net/releases/#7.4.0) (has reached its end of life on November 28, 2022)
+- [PHP 8.0](https://www.php.net/releases/#8.0.0) (has reached its end of life on November 26, 2023)
+- [PHP 8.1](https://www.php.net/releases/#8.1.0) (has reached its end of life on December 31, 2025)
+- [PHP 8.2](https://www.php.net/releases/#8.2.0)
+- [PHP 8.3](https://www.php.net/releases/#8.3.0)
+- [PHP 8.4](https://www.php.net/releases/#8.4.0)
+- [PHP 8.5](https://www.php.net/releases/#8.5.0)
+
+The maintainers of this project add support for a PHP version following its initial release and _may_ drop support for a PHP version when it has reached its [end of life](https://www.php.net/supported-versions.php).
+
+## Security Policy
+
+This project has a [security policy](.github/SECURITY.md).
+
+## License
+
+This project uses the [MIT license](LICENSE.md).
+
+
+## Credits
+
+The agent detector is inspired by [`shipfastlabs/agent-detector`](https://github.com/shipfastlabs/agent-detector), originally licensed under MIT by [Pushpak Chhajed](https://github.com/pushpak1300).
+
+## Social
+
+Follow [@localheinz](https://twitter.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://twitter.com/intent/follow?screen_name=ergebnis) on Twitter.
diff --git a/trilhas_poo/vendor/ergebnis/agent-detector/composer.json b/trilhas_poo/vendor/ergebnis/agent-detector/composer.json
new file mode 100644
index 0000000..fa88ce2
--- /dev/null
+++ b/trilhas_poo/vendor/ergebnis/agent-detector/composer.json
@@ -0,0 +1,74 @@
+{
+ "name": "ergebnis/agent-detector",
+ "description": "Provides a detector for detecting the presence of an agent.",
+ "license": "MIT",
+ "type": "library",
+ "authors": [
+ {
+ "name": "Andreas Möller",
+ "email": "am@localheinz.com",
+ "homepage": "https://localheinz.com"
+ }
+ ],
+ "homepage": "https://github.com/ergebnis/agent-detector",
+ "support": {
+ "issues": "https://github.com/ergebnis/agent-detector/issues",
+ "source": "https://github.com/ergebnis/agent-detector",
+ "security": "https://github.com/ergebnis/agent-detector/blob/main/.github/SECURITY.md"
+ },
+ "require": {
+ "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0"
+ },
+ "require-dev": {
+ "ergebnis/composer-normalize": "^2.51.0",
+ "ergebnis/license": "^2.7.0",
+ "ergebnis/php-cs-fixer-config": "^6.60.2",
+ "ergebnis/phpstan-rules": "^2.13.1",
+ "ergebnis/phpunit-slow-test-detector": "^2.24.0",
+ "ergebnis/rector-rules": "^1.18.1",
+ "fakerphp/faker": "^1.24.1",
+ "infection/infection": "^0.26.6",
+ "phpstan/extension-installer": "^1.4.3",
+ "phpstan/phpstan": "^2.1.54",
+ "phpstan/phpstan-deprecation-rules": "^2.0.4",
+ "phpstan/phpstan-phpunit": "^2.0.16",
+ "phpstan/phpstan-strict-rules": "^2.0.10",
+ "phpunit/phpunit": "^9.6.34",
+ "rector/rector": "^2.4.2"
+ },
+ "autoload": {
+ "psr-4": {
+ "Ergebnis\\AgentDetector\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Ergebnis\\AgentDetector\\Test\\": "test/"
+ }
+ },
+ "config": {
+ "allow-plugins": {
+ "composer/package-versions-deprecated": true,
+ "ergebnis/composer-normalize": true,
+ "infection/extension-installer": true,
+ "phpstan/extension-installer": true
+ },
+ "audit": {
+ "abandoned": "report"
+ },
+ "platform": {
+ "php": "7.4.33"
+ },
+ "preferred-install": "dist",
+ "sort-packages": true
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.2-dev"
+ },
+ "composer-normalize": {
+ "indent-size": 2,
+ "indent-style": "space"
+ }
+ }
+}
diff --git a/trilhas_poo/vendor/ergebnis/agent-detector/src/Detector.php b/trilhas_poo/vendor/ergebnis/agent-detector/src/Detector.php
new file mode 100644
index 0000000..54f3bdb
--- /dev/null
+++ b/trilhas_poo/vendor/ergebnis/agent-detector/src/Detector.php
@@ -0,0 +1,68 @@
+
+ */
+ private const AGENT_ENVIRONMENT_VARIABLES = [
+ 'AI_AGENT' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'AMP_CURRENT_THREAD_ID' => 'https://github.com/shipfastlabs/agent-detector/blob/main/src/AgentDetector.php',
+ 'ANTIGRAVITY_AGENT' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'AUGMENT_AGENT' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'CLAUDECODE' => 'https://github.com/anthropics/claude-code/blob/main/src/utils/env.ts',
+ 'CLAUDE_CODE' => 'https://github.com/anthropics/claude-code/blob/main/src/utils/env.ts',
+ 'CLAUDE_CODE_IS_COWORK' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'CODEX_CI' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'CODEX_SANDBOX' => 'https://github.com/openai/codex/blob/main/codex-rs/core/src/seatbelt.rs',
+ 'CODEX_THREAD_ID' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'COPILOT_ALLOW_ALL' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'COPILOT_CLI' => 'https://github.com/github/copilot-cli',
+ 'COPILOT_GITHUB_TOKEN' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'COPILOT_MODEL' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'CURSOR_AGENT' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'CURSOR_EXTENSION_HOST_ROLE' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'CURSOR_TRACE_ID' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ 'GEMINI_CLI' => 'https://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/tools/shell/shell-tool.ts',
+ 'OPENCODE' => 'https://github.com/shipfastlabs/agent-detector/blob/main/src/AgentDetector.php',
+ 'OPENCODE_CLIENT' => 'https://github.com/sst/opencode/blob/dev/packages/opencode/src/flag/flag.ts',
+ 'PI_CODING_AGENT' => 'https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/index.ts',
+ 'REPL_ID' => 'https://github.com/vercel/vercel/blob/main/packages/detect-agent/src/index.ts',
+ ];
+
+ /**
+ * @param array $environmentVariables
+ */
+ public function isAgentPresent(array $environmentVariables): bool
+ {
+ foreach (self::AGENT_ENVIRONMENT_VARIABLES as $variable => $url) {
+ if (\array_key_exists($variable, $environmentVariables)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/trilhas_poo/vendor/evenement/evenement/.gitattributes b/trilhas_poo/vendor/evenement/evenement/.gitattributes
new file mode 100644
index 0000000..8e493b8
--- /dev/null
+++ b/trilhas_poo/vendor/evenement/evenement/.gitattributes
@@ -0,0 +1,7 @@
+/.github export-ignore
+/doc export-ignore
+/examples export-ignore
+/tests export-ignore
+/.gitignore export-ignore
+/CHANGELOG.md export-ignore
+/phpunit.xml.dist export-ignore
diff --git a/trilhas_poo/vendor/evenement/evenement/LICENSE b/trilhas_poo/vendor/evenement/evenement/LICENSE
new file mode 100644
index 0000000..d9a37d0
--- /dev/null
+++ b/trilhas_poo/vendor/evenement/evenement/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Igor Wiedler
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/trilhas_poo/vendor/evenement/evenement/README.md b/trilhas_poo/vendor/evenement/evenement/README.md
new file mode 100644
index 0000000..455dd22
--- /dev/null
+++ b/trilhas_poo/vendor/evenement/evenement/README.md
@@ -0,0 +1,64 @@
+# Événement
+
+Événement is a very simple event dispatching library for PHP.
+
+It has the same design goals as [Silex](https://silex.symfony.com/) and
+[Pimple](https://github.com/silexphp/Pimple), to empower the user while staying concise
+and simple.
+
+It is very strongly inspired by the [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter) API found in
+[node.js](http://nodejs.org).
+
+
+[](https://packagist.org/packages/evenement/evenement)
+[](https://packagist.org/packages/evenement/evenement/stats)
+[](https://packagist.org/packages/evenement/evenement)
+
+## Fetch
+
+The recommended way to install Événement is [through composer](http://getcomposer.org). By running the following command:
+
+ $ composer require evenement/evenement
+
+## Usage
+
+### Creating an Emitter
+
+```php
+on('user.created', function (User $user) use ($logger) {
+ $logger->log(sprintf("User '%s' was created.", $user->getLogin()));
+});
+```
+
+### Removing Listeners
+
+```php
+removeListener('user.created', function (User $user) use ($logger) {
+ $logger->log(sprintf("User '%s' was created.", $user->getLogin()));
+});
+```
+
+### Emitting Events
+
+```php
+emit('user.created', [$user]);
+```
+
+Tests
+-----
+
+ $ ./vendor/bin/phpunit
+
+License
+-------
+MIT, see LICENSE.
diff --git a/trilhas_poo/vendor/evenement/evenement/composer.json b/trilhas_poo/vendor/evenement/evenement/composer.json
new file mode 100644
index 0000000..5444d93
--- /dev/null
+++ b/trilhas_poo/vendor/evenement/evenement/composer.json
@@ -0,0 +1,29 @@
+{
+ "name": "evenement/evenement",
+ "description": "Événement is a very simple event dispatching library for PHP",
+ "keywords": ["event-dispatcher", "event-emitter"],
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch"
+ }
+ ],
+ "require": {
+ "php": ">=7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9 || ^6"
+ },
+ "autoload": {
+ "psr-4": {
+ "Evenement\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Evenement\\Tests\\": "tests/"
+ },
+ "files": ["tests/functions.php"]
+ }
+}
diff --git a/trilhas_poo/vendor/evenement/evenement/src/EventEmitter.php b/trilhas_poo/vendor/evenement/evenement/src/EventEmitter.php
new file mode 100644
index 0000000..db189b9
--- /dev/null
+++ b/trilhas_poo/vendor/evenement/evenement/src/EventEmitter.php
@@ -0,0 +1,17 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Evenement;
+
+class EventEmitter implements EventEmitterInterface
+{
+ use EventEmitterTrait;
+}
diff --git a/trilhas_poo/vendor/evenement/evenement/src/EventEmitterInterface.php b/trilhas_poo/vendor/evenement/evenement/src/EventEmitterInterface.php
new file mode 100644
index 0000000..310631a
--- /dev/null
+++ b/trilhas_poo/vendor/evenement/evenement/src/EventEmitterInterface.php
@@ -0,0 +1,22 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Evenement;
+
+interface EventEmitterInterface
+{
+ public function on($event, callable $listener);
+ public function once($event, callable $listener);
+ public function removeListener($event, callable $listener);
+ public function removeAllListeners($event = null);
+ public function listeners($event = null);
+ public function emit($event, array $arguments = []);
+}
diff --git a/trilhas_poo/vendor/evenement/evenement/src/EventEmitterTrait.php b/trilhas_poo/vendor/evenement/evenement/src/EventEmitterTrait.php
new file mode 100644
index 0000000..1503429
--- /dev/null
+++ b/trilhas_poo/vendor/evenement/evenement/src/EventEmitterTrait.php
@@ -0,0 +1,154 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Evenement;
+
+use InvalidArgumentException;
+
+use function count;
+use function array_keys;
+use function array_merge;
+use function array_search;
+use function array_unique;
+use function array_values;
+
+trait EventEmitterTrait
+{
+ protected $listeners = [];
+ protected $onceListeners = [];
+
+ public function on($event, callable $listener)
+ {
+ if ($event === null) {
+ throw new InvalidArgumentException('event name must not be null');
+ }
+
+ if (!isset($this->listeners[$event])) {
+ $this->listeners[$event] = [];
+ }
+
+ $this->listeners[$event][] = $listener;
+
+ return $this;
+ }
+
+ public function once($event, callable $listener)
+ {
+ if ($event === null) {
+ throw new InvalidArgumentException('event name must not be null');
+ }
+
+ if (!isset($this->onceListeners[$event])) {
+ $this->onceListeners[$event] = [];
+ }
+
+ $this->onceListeners[$event][] = $listener;
+
+ return $this;
+ }
+
+ public function removeListener($event, callable $listener)
+ {
+ if ($event === null) {
+ throw new InvalidArgumentException('event name must not be null');
+ }
+
+ if (isset($this->listeners[$event])) {
+ $index = array_search($listener, $this->listeners[$event], true);
+ if (false !== $index) {
+ unset($this->listeners[$event][$index]);
+ if (count($this->listeners[$event]) === 0) {
+ unset($this->listeners[$event]);
+ }
+ }
+ }
+
+ if (isset($this->onceListeners[$event])) {
+ $index = array_search($listener, $this->onceListeners[$event], true);
+ if (false !== $index) {
+ unset($this->onceListeners[$event][$index]);
+ if (count($this->onceListeners[$event]) === 0) {
+ unset($this->onceListeners[$event]);
+ }
+ }
+ }
+ }
+
+ public function removeAllListeners($event = null)
+ {
+ if ($event !== null) {
+ unset($this->listeners[$event]);
+ } else {
+ $this->listeners = [];
+ }
+
+ if ($event !== null) {
+ unset($this->onceListeners[$event]);
+ } else {
+ $this->onceListeners = [];
+ }
+ }
+
+ public function listeners($event = null): array
+ {
+ if ($event === null) {
+ $events = [];
+ $eventNames = array_unique(
+ array_merge(
+ array_keys($this->listeners),
+ array_keys($this->onceListeners)
+ )
+ );
+ foreach ($eventNames as $eventName) {
+ $events[$eventName] = array_merge(
+ isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : [],
+ isset($this->onceListeners[$eventName]) ? $this->onceListeners[$eventName] : []
+ );
+ }
+ return $events;
+ }
+
+ return array_merge(
+ isset($this->listeners[$event]) ? $this->listeners[$event] : [],
+ isset($this->onceListeners[$event]) ? $this->onceListeners[$event] : []
+ );
+ }
+
+ public function emit($event, array $arguments = [])
+ {
+ if ($event === null) {
+ throw new InvalidArgumentException('event name must not be null');
+ }
+
+ $listeners = [];
+ if (isset($this->listeners[$event])) {
+ $listeners = array_values($this->listeners[$event]);
+ }
+
+ $onceListeners = [];
+ if (isset($this->onceListeners[$event])) {
+ $onceListeners = array_values($this->onceListeners[$event]);
+ }
+
+ if(empty($listeners) === false) {
+ foreach ($listeners as $listener) {
+ $listener(...$arguments);
+ }
+ }
+
+ if(empty($onceListeners) === false) {
+ unset($this->onceListeners[$event]);
+ foreach ($onceListeners as $listener) {
+ $listener(...$arguments);
+ }
+ }
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/.envrc b/trilhas_poo/vendor/fidry/cpu-core-counter/.envrc
new file mode 100644
index 0000000..a7c02ef
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/.envrc
@@ -0,0 +1,5 @@
+use nix --packages \
+ gnumake \
+ yamllint
+
+source_env_if_exists .envrc.local
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/LICENSE.md b/trilhas_poo/vendor/fidry/cpu-core-counter/LICENSE.md
new file mode 100644
index 0000000..0244213
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/LICENSE.md
@@ -0,0 +1,16 @@
+# The MIT License (MIT)
+
+Copyright (c) 2022 Théo FIDRY
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+documentation files (the _Software_), to deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED **AS IS**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/README.md b/trilhas_poo/vendor/fidry/cpu-core-counter/README.md
new file mode 100644
index 0000000..6b554d2
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/README.md
@@ -0,0 +1,138 @@
+# CPU Core Counter
+
+This package is a tiny utility to get the number of CPU cores.
+
+```sh
+composer require fidry/cpu-core-counter
+```
+
+
+## Usage
+
+```php
+use Fidry\CpuCoreCounter\CpuCoreCounter;
+use Fidry\CpuCoreCounter\NumberOfCpuCoreNotFound;
+use Fidry\CpuCoreCounter\Finder\DummyCpuCoreFinder;
+
+$counter = new CpuCoreCounter();
+
+// For knowing the number of cores you can use for launching parallel processes:
+$counter->getAvailableForParallelisation()->availableCpus;
+
+// Get the number of CPU cores (by default it will use the logical cores count):
+try {
+ $counter->getCount(); // e.g. 8
+} catch (NumberOfCpuCoreNotFound) {
+ return 1; // Fallback value
+}
+
+// An alternative form where we not want to catch the exception:
+
+$counter = new CpuCoreCounter([
+ ...CpuCoreCounter::getDefaultFinders(),
+ new DummyCpuCoreFinder(1), // Fallback value
+]);
+
+// A type-safe alternative form:
+$counter->getCountWithFallback(1);
+
+// Note that the result is memoized.
+$counter->getCount(); // e.g. 8
+
+```
+
+
+## Advanced usage
+
+### Changing the finders
+
+When creating `CpuCoreCounter`, you may want to change the order of the finders
+used or disable a specific finder. You can easily do so by passing the finders
+you want
+
+```php
+// Remove WindowsWmicFinder
+$finders = array_filter(
+ CpuCoreCounter::getDefaultFinders(),
+ static fn (CpuCoreFinder $finder) => !($finder instanceof WindowsWmicFinder)
+);
+
+$cores = (new CpuCoreCounter($finders))->getCount();
+```
+
+```php
+// Use CPUInfo first & don't use Nproc
+$finders = [
+ new CpuInfoFinder(),
+ new WindowsWmicFinder(),
+ new HwLogicalFinder(),
+];
+
+$cores = (new CpuCoreCounter($finders))->getCount();
+```
+
+### Choosing only logical or physical finders
+
+`FinderRegistry` provides two helpful entries:
+
+- `::getDefaultLogicalFinders()`: gives an ordered list of finders that will
+ look for the _logical_ CPU cores count.
+- `::getDefaultPhysicalFinders()`: gives an ordered list of finders that will
+ look for the _physical_ CPU cores count.
+
+By default, when using `CpuCoreCounter`, it will use the logical finders since
+it is more likely what you are looking for and is what is used by PHP source to
+build the PHP binary.
+
+
+### Checks what finders find what on your system
+
+You have three scrips available that provides insight about what the finders
+can find:
+
+```shell
+# Checks what each given finder will find on your system with details about the
+# information it had.
+make diagnose # From this repository
+./vendor/fidry/cpu-core-counter/bin/diagnose.php # From the library
+```
+
+And:
+```shell
+# Execute all finders and display the result they found.
+make execute # From this repository
+./vendor/fidry/cpu-core-counter/bin/execute.php # From the library
+```
+
+
+### Debug the results found
+
+You have 3 methods available to help you find out what happened:
+
+1. If you are using the default configuration of finder registries, you can check
+ the previous section which will provide plenty of information.
+2. If what you are interested in is how many CPU cores were found, you can use
+ the `CpuCoreCounter::trace()` method.
+3. If what you are interested in is how the calculation of CPU cores available
+ for parallelisation was done, you can inspect the values of `ParallelisationResult`
+ returned by `CpuCoreCounter::getAvailableForParallelisation()`.
+
+
+## Backward Compatibility Promise (BCP)
+
+The policy is for the major part following the same as [Symfony's one][symfony-bc-policy].
+Note that the code marked as `@private` or `@internal` are excluded from the BCP.
+
+The following elements are also excluded:
+
+- The `diagnose` and `execute` commands: those are for debugging/inspection purposes only
+- `FinderRegistry::get*Finders()`: new finders may be added or the order of finders changed at any time
+
+
+## License
+
+This package is licensed using the MIT License.
+
+Please have a look at [`LICENSE.md`](LICENSE.md).
+
+[symfony-bc-policy]: https://symfony.com/doc/current/contributing/code/bc.html
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/bin/diagnose.php b/trilhas_poo/vendor/fidry/cpu-core-counter/bin/diagnose.php
new file mode 100755
index 0000000..7dd894a
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/bin/diagnose.php
@@ -0,0 +1,27 @@
+#!/usr/bin/env php
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+use Fidry\CpuCoreCounter\Diagnoser;
+use Fidry\CpuCoreCounter\Finder\FinderRegistry;
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+echo 'Running diagnosis...'.PHP_EOL.PHP_EOL;
+echo Diagnoser::diagnose(FinderRegistry::getAllVariants()).PHP_EOL;
+
+echo 'Logical CPU cores finders...'.PHP_EOL.PHP_EOL;
+echo Diagnoser::diagnose(FinderRegistry::getDefaultLogicalFinders()).PHP_EOL;
+
+echo 'Physical CPU cores finders...'.PHP_EOL.PHP_EOL;
+echo Diagnoser::diagnose(FinderRegistry::getDefaultPhysicalFinders()).PHP_EOL;
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/bin/execute.php b/trilhas_poo/vendor/fidry/cpu-core-counter/bin/execute.php
new file mode 100755
index 0000000..edadebb
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/bin/execute.php
@@ -0,0 +1,21 @@
+#!/usr/bin/env php
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+use Fidry\CpuCoreCounter\Diagnoser;
+use Fidry\CpuCoreCounter\Finder\FinderRegistry;
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+echo 'Executing finders...'.PHP_EOL.PHP_EOL;
+echo Diagnoser::execute(FinderRegistry::getAllVariants()).PHP_EOL;
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/bin/trace.php b/trilhas_poo/vendor/fidry/cpu-core-counter/bin/trace.php
new file mode 100755
index 0000000..adb52e2
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/bin/trace.php
@@ -0,0 +1,32 @@
+#!/usr/bin/env php
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+use Fidry\CpuCoreCounter\CpuCoreCounter;
+use Fidry\CpuCoreCounter\Finder\FinderRegistry;
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+$separator = str_repeat('–', 80);
+
+echo 'With all finders...'.PHP_EOL.PHP_EOL;
+echo (new CpuCoreCounter(FinderRegistry::getAllVariants()))->trace().PHP_EOL;
+echo $separator.PHP_EOL.PHP_EOL;
+
+echo 'Logical CPU cores finders...'.PHP_EOL.PHP_EOL;
+echo (new CpuCoreCounter(FinderRegistry::getDefaultLogicalFinders()))->trace().PHP_EOL;
+echo $separator.PHP_EOL.PHP_EOL;
+
+echo 'Physical CPU cores finders...'.PHP_EOL.PHP_EOL;
+echo (new CpuCoreCounter(FinderRegistry::getDefaultPhysicalFinders()))->trace().PHP_EOL;
+echo $separator.PHP_EOL.PHP_EOL;
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/composer.json b/trilhas_poo/vendor/fidry/cpu-core-counter/composer.json
new file mode 100644
index 0000000..6ca8df6
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/composer.json
@@ -0,0 +1,48 @@
+{
+ "name": "fidry/cpu-core-counter",
+ "description": "Tiny utility to get the number of CPU cores.",
+ "license": "MIT",
+ "type": "library",
+ "keywords": [
+ "cpu",
+ "core"
+ ],
+ "authors": [
+ {
+ "name": "Théo FIDRY",
+ "email": "theo.fidry@gmail.com"
+ }
+ ],
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "require-dev": {
+ "fidry/makefile": "^0.2.0",
+ "fidry/php-cs-fixer-config": "^1.1.2",
+ "phpstan/extension-installer": "^1.2.0",
+ "phpstan/phpstan": "^2.0",
+ "phpstan/phpstan-deprecation-rules": "^2.0.0",
+ "phpstan/phpstan-phpunit": "^2.0",
+ "phpstan/phpstan-strict-rules": "^2.0",
+ "phpunit/phpunit": "^8.5.31 || ^9.5.26",
+ "webmozarts/strict-phpunit": "^7.5"
+ },
+ "autoload": {
+ "psr-4": {
+ "Fidry\\CpuCoreCounter\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Fidry\\CpuCoreCounter\\Test\\": "tests/"
+ }
+ },
+ "config": {
+ "allow-plugins": {
+ "ergebnis/composer-normalize": true,
+ "infection/extension-installer": true,
+ "phpstan/extension-installer": true
+ },
+ "sort-packages": true
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php
new file mode 100644
index 0000000..d115031
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/CpuCoreCounter.php
@@ -0,0 +1,270 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter;
+
+use Fidry\CpuCoreCounter\Finder\CpuCoreFinder;
+use Fidry\CpuCoreCounter\Finder\EnvVariableFinder;
+use Fidry\CpuCoreCounter\Finder\FinderRegistry;
+use InvalidArgumentException;
+use function implode;
+use function max;
+use function sprintf;
+use function sys_getloadavg;
+use const PHP_EOL;
+
+final class CpuCoreCounter
+{
+ /**
+ * @var list
+ */
+ private $finders;
+
+ /**
+ * @var positive-int|null
+ */
+ private $count;
+
+ /**
+ * @param list|null $finders
+ */
+ public function __construct(?array $finders = null)
+ {
+ $this->finders = $finders ?? FinderRegistry::getDefaultLogicalFinders();
+ }
+
+ /**
+ * @param positive-int|0 $reservedCpus Number of CPUs to reserve. This is useful when you want
+ * to reserve some CPUs for other processes. If the main
+ * process is going to be busy still, you may want to set
+ * this value to 1.
+ * @param non-zero-int|null $countLimit The maximum number of CPUs to return. If not provided, it
+ * may look for a limit in the environment variables, e.g.
+ * KUBERNETES_CPU_LIMIT. If negative, the limit will be
+ * the total number of cores found minus the absolute value.
+ * For instance if the system has 10 cores and countLimit=-2,
+ * then the effective limit considered will be 8.
+ * @param float|null $loadLimit Element of [0., 1.]. Percentage representing the
+ * amount of cores that should be used among the available
+ * resources. For instance, if set to 0.7, it will use 70%
+ * of the available cores, i.e. if 1 core is reserved, 11
+ * cores are available and 5 are busy, it will use 70%
+ * of (11-1-5)=5 cores, so 3 cores. Set this parameter to null
+ * to skip this check. Beware that 1 does not mean "no limit",
+ * but 100% of the _available_ resources, i.e. with the
+ * previous example, it will return 5 cores. How busy is
+ * the system is determined by the system load average
+ * (see $systemLoadAverage).
+ * @param float|null $systemLoadAverage The system load average. If passed, it will use
+ * this information to limit the available cores based
+ * on the _available_ resources. For instance, if there
+ * is 10 cores but 3 are busy, then only 7 cores will
+ * be considered for further calculation. If set to
+ * `null`, it will use `sys_getloadavg()` to check the
+ * load of the system in the past minute. You can
+ * otherwise pass an arbitrary value. Should be a
+ * positive float.
+ *
+ * @see https://php.net/manual/en/function.sys-getloadavg.php
+ */
+ public function getAvailableForParallelisation(
+ int $reservedCpus = 0,
+ ?int $countLimit = null,
+ ?float $loadLimit = null,
+ ?float $systemLoadAverage = 0.
+ ): ParallelisationResult {
+ self::checkCountLimit($countLimit);
+ self::checkLoadLimit($loadLimit);
+ self::checkSystemLoadAverage($systemLoadAverage);
+
+ $totalCoreCount = $this->getCountWithFallback(1);
+ $availableCores = max(1, $totalCoreCount - $reservedCpus);
+
+ // Adjust available CPUs based on current load
+ if (null !== $loadLimit) {
+ // https://github.com/phpstan/phpstan/issues/13198
+ /** @var float $correctedSystemLoadAverage */
+ $correctedSystemLoadAverage = null === $systemLoadAverage
+ ? sys_getloadavg()[0] ?? 0.
+ : $systemLoadAverage;
+
+ $availableCores = max(
+ 1,
+ $loadLimit * ($availableCores - $correctedSystemLoadAverage)
+ );
+ }
+
+ if (null === $countLimit) {
+ $correctedCountLimit = self::getKubernetesLimit();
+ } else {
+ $correctedCountLimit = $countLimit > 0
+ ? $countLimit
+ : max(1, $totalCoreCount + $countLimit);
+ }
+
+ if (null !== $correctedCountLimit && $availableCores > $correctedCountLimit) {
+ $availableCores = $correctedCountLimit;
+ }
+
+ return new ParallelisationResult(
+ $reservedCpus,
+ $countLimit,
+ $loadLimit,
+ $systemLoadAverage,
+ $correctedCountLimit,
+ $correctedSystemLoadAverage ?? $systemLoadAverage,
+ $totalCoreCount,
+ (int) $availableCores
+ );
+ }
+
+ /**
+ * @throws NumberOfCpuCoreNotFound
+ *
+ * @return positive-int
+ */
+ public function getCount(): int
+ {
+ // Memoize result
+ if (null === $this->count) {
+ $this->count = $this->findCount();
+ }
+
+ return $this->count;
+ }
+
+ /**
+ * @param positive-int $fallback
+ *
+ * @return positive-int
+ */
+ public function getCountWithFallback(int $fallback): int
+ {
+ try {
+ return $this->getCount();
+ } catch (NumberOfCpuCoreNotFound $exception) {
+ return $fallback;
+ }
+ }
+
+ /**
+ * This method is mostly for debugging purposes.
+ */
+ public function trace(): string
+ {
+ $output = [];
+
+ foreach ($this->finders as $finder) {
+ $output[] = sprintf(
+ 'Executing the finder "%s":',
+ $finder->toString()
+ );
+ $output[] = $finder->diagnose();
+
+ $cores = $finder->find();
+
+ if (null !== $cores) {
+ $output[] = 'Result found: '.$cores;
+
+ break;
+ }
+
+ $output[] = '–––';
+ }
+
+ return implode(PHP_EOL, $output);
+ }
+
+ /**
+ * @throws NumberOfCpuCoreNotFound
+ *
+ * @return positive-int
+ */
+ private function findCount(): int
+ {
+ foreach ($this->finders as $finder) {
+ $cores = $finder->find();
+
+ if (null !== $cores) {
+ return $cores;
+ }
+ }
+
+ throw NumberOfCpuCoreNotFound::create();
+ }
+
+ /**
+ * @throws NumberOfCpuCoreNotFound
+ *
+ * @return array{CpuCoreFinder, positive-int}
+ */
+ public function getFinderAndCores(): array
+ {
+ foreach ($this->finders as $finder) {
+ $cores = $finder->find();
+
+ if (null !== $cores) {
+ return [$finder, $cores];
+ }
+ }
+
+ throw NumberOfCpuCoreNotFound::create();
+ }
+
+ /**
+ * @return positive-int|null
+ */
+ public static function getKubernetesLimit(): ?int
+ {
+ $finder = new EnvVariableFinder('KUBERNETES_CPU_LIMIT');
+
+ return $finder->find();
+ }
+
+ private static function checkCountLimit(?int $countLimit): void
+ {
+ if (0 === $countLimit) {
+ throw new InvalidArgumentException(
+ 'The count limit must be a non zero integer. Got "0".'
+ );
+ }
+ }
+
+ private static function checkLoadLimit(?float $loadLimit): void
+ {
+ if (null === $loadLimit) {
+ return;
+ }
+
+ if ($loadLimit < 0. || $loadLimit > 1.) {
+ throw new InvalidArgumentException(
+ sprintf(
+ 'The load limit must be in the range [0., 1.], got "%s".',
+ $loadLimit
+ )
+ );
+ }
+ }
+
+ private static function checkSystemLoadAverage(?float $systemLoadAverage): void
+ {
+ if (null !== $systemLoadAverage && $systemLoadAverage < 0.) {
+ throw new InvalidArgumentException(
+ sprintf(
+ 'The system load average must be a positive float, got "%s".',
+ $systemLoadAverage
+ )
+ );
+ }
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Diagnoser.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Diagnoser.php
new file mode 100644
index 0000000..872b55f
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Diagnoser.php
@@ -0,0 +1,101 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter;
+
+use Fidry\CpuCoreCounter\Finder\CpuCoreFinder;
+use function array_map;
+use function explode;
+use function implode;
+use function max;
+use function str_repeat;
+use const PHP_EOL;
+
+/**
+ * Utility to debug.
+ *
+ * @private
+ */
+final class Diagnoser
+{
+ /**
+ * Provides an aggregated diagnosis based on each finders diagnosis.
+ *
+ * @param list $finders
+ */
+ public static function diagnose(array $finders): string
+ {
+ $diagnoses = array_map(
+ static function (CpuCoreFinder $finder): string {
+ return self::diagnoseFinder($finder);
+ },
+ $finders
+ );
+
+ return implode(PHP_EOL, $diagnoses);
+ }
+
+ /**
+ * Executes each finders.
+ *
+ * @param list $finders
+ */
+ public static function execute(array $finders): string
+ {
+ $diagnoses = array_map(
+ static function (CpuCoreFinder $finder): string {
+ $coresCount = $finder->find();
+
+ return implode(
+ '',
+ [
+ $finder->toString(),
+ ': ',
+ null === $coresCount ? 'NULL' : $coresCount,
+ ]
+ );
+ },
+ $finders
+ );
+
+ return implode(PHP_EOL, $diagnoses);
+ }
+
+ private static function diagnoseFinder(CpuCoreFinder $finder): string
+ {
+ $diagnosis = $finder->diagnose();
+
+ $maxLineLength = max(
+ array_map(
+ 'strlen',
+ explode(PHP_EOL, $diagnosis)
+ )
+ );
+
+ $separator = str_repeat('-', $maxLineLength);
+
+ return implode(
+ '',
+ [
+ $finder->toString().':'.PHP_EOL,
+ $separator.PHP_EOL,
+ $diagnosis.PHP_EOL,
+ $separator.PHP_EOL,
+ ]
+ );
+ }
+
+ private function __construct()
+ {
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php
new file mode 100644
index 0000000..d526ce1
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Executor/ProcOpenExecutor.php
@@ -0,0 +1,57 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Executor;
+
+use function fclose;
+use function function_exists;
+use function is_resource;
+use function proc_close;
+use function proc_open;
+use function stream_get_contents;
+
+final class ProcOpenExecutor implements ProcessExecutor
+{
+ public function execute(string $command): ?array
+ {
+ if (!function_exists('proc_open')) {
+ return null;
+ }
+
+ $pipes = [];
+
+ $process = @proc_open(
+ $command,
+ [
+ ['pipe', 'rb'],
+ ['pipe', 'wb'], // stdout
+ ['pipe', 'wb'], // stderr
+ ],
+ $pipes
+ );
+ // https://github.com/phpstan/phpstan/issues/13197
+ /** @var array{resource, resource, resource} $pipes */
+ if (!is_resource($process)) {
+ return null;
+ }
+
+ fclose($pipes[0]);
+
+ $stdout = stream_get_contents($pipes[1]);
+ $stderr = stream_get_contents($pipes[2]);
+
+ proc_close($process);
+
+ return [$stdout, $stderr];
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php
new file mode 100644
index 0000000..287c01e
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Executor/ProcessExecutor.php
@@ -0,0 +1,22 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Executor;
+
+interface ProcessExecutor
+{
+ /**
+ * @return array{string, string}|null STDOUT & STDERR tuple
+ */
+ public function execute(string $command): ?array;
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php
new file mode 100644
index 0000000..4065064
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletLogicalFinder.php
@@ -0,0 +1,47 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function preg_match;
+
+/**
+ * Find the number of logical CPU cores for Windows leveraging the Get-CimInstance
+ * cmdlet, which is a newer version that is recommended over Get-WmiObject.
+ */
+final class CmiCmdletLogicalFinder extends ProcOpenBasedFinder
+{
+ private const CPU_CORE_COUNT_REGEX = '/NumberOfLogicalProcessors[\s\n]-+[\s\n]+(?\d+)/';
+
+ protected function getCommand(): string
+ {
+ return 'Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property NumberOfLogicalProcessors';
+ }
+
+ public function toString(): string
+ {
+ return 'CmiCmdletLogicalFinder';
+ }
+
+ protected function countCpuCores(string $process): ?int
+ {
+ if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) {
+ return parent::countCpuCores($process);
+ }
+
+ /** @phpstan-ignore offsetAccess.notFound */
+ $count = $matches['count'];
+
+ return parent::countCpuCores($count);
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php
new file mode 100644
index 0000000..4559021
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CmiCmdletPhysicalFinder.php
@@ -0,0 +1,48 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function preg_match;
+
+/**
+ * Find the number of physical CPU cores for Windows.
+ *
+ * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L912-L916
+ */
+final class CmiCmdletPhysicalFinder extends ProcOpenBasedFinder
+{
+ private const CPU_CORE_COUNT_REGEX = '/NumberOfCores[\s\n]-+[\s\n]+(?\d+)/';
+
+ protected function getCommand(): string
+ {
+ return 'Get-CimInstance -ClassName Win32_Processor | Select-Object -Property NumberOfCores';
+ }
+
+ public function toString(): string
+ {
+ return 'CmiCmdletPhysicalFinder';
+ }
+
+ protected function countCpuCores(string $process): ?int
+ {
+ if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) {
+ return parent::countCpuCores($process);
+ }
+
+ /** @phpstan-ignore offsetAccess.notFound */
+ $count = $matches['count'];
+
+ return parent::countCpuCores($count);
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php
new file mode 100644
index 0000000..edb40e8
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CpuCoreFinder.php
@@ -0,0 +1,37 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+interface CpuCoreFinder
+{
+ /**
+ * Provides an explanation which may offer some insight as to what the finder
+ * will be able to find.
+ *
+ * This is practical to have an idea of what each finder will find collect
+ * information for the unit tests, since integration tests are quite complicated
+ * as dependent on complex infrastructures.
+ */
+ public function diagnose(): string;
+
+ /**
+ * Find the number of CPU cores. If it could not find it, returns null. The
+ * means used to find the cores are at the implementation discretion.
+ *
+ * @return positive-int|null
+ */
+ public function find(): ?int;
+
+ public function toString(): string;
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php
new file mode 100644
index 0000000..8013877
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/CpuInfoFinder.php
@@ -0,0 +1,100 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function file_get_contents;
+use function is_file;
+use function sprintf;
+use function substr_count;
+use const PHP_EOL;
+
+/**
+ * Find the number of CPU cores looking up at the cpuinfo file which is available
+ * on Linux systems and Windows systems with a Linux sub-system.
+ *
+ * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L903-L909
+ * @see https://unix.stackexchange.com/questions/146051/number-of-processors-in-proc-cpuinfo
+ */
+final class CpuInfoFinder implements CpuCoreFinder
+{
+ private const CPU_INFO_PATH = '/proc/cpuinfo';
+
+ public function diagnose(): string
+ {
+ if (!is_file(self::CPU_INFO_PATH)) {
+ return sprintf(
+ 'The file "%s" could not be found.',
+ self::CPU_INFO_PATH
+ );
+ }
+
+ $cpuInfo = file_get_contents(self::CPU_INFO_PATH);
+
+ if (false === $cpuInfo) {
+ return sprintf(
+ 'Could not get the content of the file "%s".',
+ self::CPU_INFO_PATH
+ );
+ }
+
+ return sprintf(
+ 'Found the file "%s" with the content:%s%s%sWill return "%s".',
+ self::CPU_INFO_PATH,
+ PHP_EOL,
+ $cpuInfo,
+ PHP_EOL,
+ self::countCpuCores($cpuInfo)
+ );
+ }
+
+ /**
+ * @return positive-int|null
+ */
+ public function find(): ?int
+ {
+ $cpuInfo = self::getCpuInfo();
+
+ return null === $cpuInfo ? null : self::countCpuCores($cpuInfo);
+ }
+
+ public function toString(): string
+ {
+ return 'CpuInfoFinder';
+ }
+
+ private static function getCpuInfo(): ?string
+ {
+ if (!@is_file(self::CPU_INFO_PATH)) {
+ return null;
+ }
+
+ $cpuInfo = @file_get_contents(self::CPU_INFO_PATH);
+
+ return false === $cpuInfo
+ ? null
+ : $cpuInfo;
+ }
+
+ /**
+ * @internal
+ *
+ * @return positive-int|null
+ */
+ public static function countCpuCores(string $cpuInfo): ?int
+ {
+ $processorCount = substr_count($cpuInfo, 'processor');
+
+ return $processorCount > 0 ? $processorCount : null;
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php
new file mode 100644
index 0000000..8c99612
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/DummyCpuCoreFinder.php
@@ -0,0 +1,58 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function sprintf;
+
+/**
+ * This finder returns whatever value you gave to it. This is useful for testing
+ * or as a fallback to avoid to catch the NumberOfCpuCoreNotFound exception.
+ */
+final class DummyCpuCoreFinder implements CpuCoreFinder
+{
+ /**
+ * @var positive-int
+ */
+ private $count;
+
+ public function diagnose(): string
+ {
+ return sprintf(
+ 'Will return "%d".',
+ $this->count
+ );
+ }
+
+ /**
+ * @param positive-int $count
+ */
+ public function __construct(int $count)
+ {
+ $this->count = $count;
+ }
+
+ /** @phpstan-ignore return.unusedType */
+ public function find(): ?int
+ {
+ return $this->count;
+ }
+
+ public function toString(): string
+ {
+ return sprintf(
+ 'DummyCpuCoreFinder(value=%d)',
+ $this->count
+ );
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php
new file mode 100644
index 0000000..52d0411
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/EnvVariableFinder.php
@@ -0,0 +1,74 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function getenv;
+use function preg_match;
+use function sprintf;
+use function var_export;
+
+final class EnvVariableFinder implements CpuCoreFinder
+{
+ /** @var string */
+ private $environmentVariableName;
+
+ public function __construct(string $environmentVariableName)
+ {
+ $this->environmentVariableName = $environmentVariableName;
+ }
+
+ public function diagnose(): string
+ {
+ $value = getenv($this->environmentVariableName);
+
+ return sprintf(
+ 'parse(getenv(%s)=%s)=%s',
+ $this->environmentVariableName,
+ var_export($value, true),
+ self::isPositiveInteger($value) ? $value : 'null'
+ );
+ }
+
+ public function find(): ?int
+ {
+ $value = getenv($this->environmentVariableName);
+
+ if (is_string($value) && 1 === preg_match('/^(\d+)m$/', $value, $matches)) {
+ $millicores = $matches[1];
+ $value = (string) floor($millicores / 1000);
+ }
+
+ return self::isPositiveInteger($value)
+ ? (int) $value
+ : null;
+ }
+
+ public function toString(): string
+ {
+ return sprintf(
+ 'getenv(%s)',
+ $this->environmentVariableName
+ );
+ }
+
+ /**
+ * @param string|false $value
+ */
+ private static function isPositiveInteger($value): bool
+ {
+ return false !== $value
+ && 1 === preg_match('/^\d+$/', $value)
+ && (int) $value > 0;
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php
new file mode 100644
index 0000000..ca9b860
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/FinderRegistry.php
@@ -0,0 +1,91 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+final class FinderRegistry
+{
+ /**
+ * @return list List of all the known finders with all their variants.
+ */
+ public static function getAllVariants(): array
+ {
+ return [
+ new CpuInfoFinder(),
+ new DummyCpuCoreFinder(1),
+ new HwLogicalFinder(),
+ new HwPhysicalFinder(),
+ new LscpuLogicalFinder(),
+ new LscpuPhysicalFinder(),
+ new _NProcessorFinder(),
+ new NProcessorFinder(),
+ new NProcFinder(true),
+ new NProcFinder(false),
+ new NullCpuCoreFinder(),
+ SkipOnOSFamilyFinder::forWindows(
+ new DummyCpuCoreFinder(1)
+ ),
+ OnlyOnOSFamilyFinder::forWindows(
+ new DummyCpuCoreFinder(1)
+ ),
+ new OnlyInPowerShellFinder(new CmiCmdletLogicalFinder()),
+ new OnlyInPowerShellFinder(new CmiCmdletPhysicalFinder()),
+ new WindowsRegistryLogicalFinder(),
+ new WmicPhysicalFinder(),
+ new WmicLogicalFinder(),
+ ];
+ }
+
+ /**
+ * @return list
+ */
+ public static function getDefaultLogicalFinders(): array
+ {
+ return [
+ OnlyOnOSFamilyFinder::forWindows(
+ new OnlyInPowerShellFinder(
+ new CmiCmdletLogicalFinder()
+ )
+ ),
+ OnlyOnOSFamilyFinder::forWindows(new WindowsRegistryLogicalFinder()),
+ OnlyOnOSFamilyFinder::forWindows(new WmicLogicalFinder()),
+ new NProcFinder(),
+ new HwLogicalFinder(),
+ new _NProcessorFinder(),
+ new NProcessorFinder(),
+ new LscpuLogicalFinder(),
+ new CpuInfoFinder(),
+ ];
+ }
+
+ /**
+ * @return list
+ */
+ public static function getDefaultPhysicalFinders(): array
+ {
+ return [
+ OnlyOnOSFamilyFinder::forWindows(
+ new OnlyInPowerShellFinder(
+ new CmiCmdletPhysicalFinder()
+ )
+ ),
+ OnlyOnOSFamilyFinder::forWindows(new WmicPhysicalFinder()),
+ new HwPhysicalFinder(),
+ new LscpuPhysicalFinder(),
+ ];
+ }
+
+ private function __construct()
+ {
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php
new file mode 100644
index 0000000..d112903
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/HwLogicalFinder.php
@@ -0,0 +1,33 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+/**
+ * Find the number of logical CPU cores for Linux, BSD and OSX.
+ *
+ * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L903-L909
+ * @see https://opensource.apple.com/source/xnu/xnu-792.2.4/libkern/libkern/sysctl.h.auto.html
+ */
+final class HwLogicalFinder extends ProcOpenBasedFinder
+{
+ protected function getCommand(): string
+ {
+ return 'sysctl -n hw.logicalcpu';
+ }
+
+ public function toString(): string
+ {
+ return 'HwLogicalFinder';
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php
new file mode 100644
index 0000000..65ca1cf
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/HwPhysicalFinder.php
@@ -0,0 +1,33 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+/**
+ * Find the number of physical CPU cores for Linux, BSD and OSX.
+ *
+ * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L903-L909
+ * @see https://opensource.apple.com/source/xnu/xnu-792.2.4/libkern/libkern/sysctl.h.auto.html
+ */
+final class HwPhysicalFinder extends ProcOpenBasedFinder
+{
+ protected function getCommand(): string
+ {
+ return 'sysctl -n hw.physicalcpu';
+ }
+
+ public function toString(): string
+ {
+ return 'HwPhysicalFinder';
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php
new file mode 100644
index 0000000..bce09eb
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/LscpuLogicalFinder.php
@@ -0,0 +1,52 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function count;
+use function explode;
+use function is_array;
+use function preg_grep;
+use const PHP_EOL;
+
+/**
+ * The number of logical cores.
+ *
+ * @see https://stackoverflow.com/a/23378780/5846754
+ */
+final class LscpuLogicalFinder extends ProcOpenBasedFinder
+{
+ public function getCommand(): string
+ {
+ return 'lscpu -p';
+ }
+
+ protected function countCpuCores(string $process): ?int
+ {
+ $lines = explode(PHP_EOL, $process);
+ $actualLines = preg_grep('/^\d+,/', $lines);
+
+ if (!is_array($actualLines)) {
+ return null;
+ }
+
+ $count = count($actualLines);
+
+ return 0 === $count ? null : $count;
+ }
+
+ public function toString(): string
+ {
+ return 'LscpuLogicalFinder';
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php
new file mode 100644
index 0000000..c89bcb9
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/LscpuPhysicalFinder.php
@@ -0,0 +1,67 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function count;
+use function explode;
+use function is_array;
+use function preg_grep;
+use function strtok;
+use const PHP_EOL;
+
+/**
+ * The number of physical processors.
+ *
+ * @see https://stackoverflow.com/a/23378780/5846754
+ */
+final class LscpuPhysicalFinder extends ProcOpenBasedFinder
+{
+ public function toString(): string
+ {
+ return 'LscpuPhysicalFinder';
+ }
+
+ public function getCommand(): string
+ {
+ return 'lscpu -p';
+ }
+
+ protected function countCpuCores(string $process): ?int
+ {
+ $lines = explode(PHP_EOL, $process);
+ /** @var string[]|false $actualLines */
+ $actualLines = preg_grep('/^\d+/', $lines);
+
+ if (!is_array($actualLines)) {
+ return null;
+ }
+
+ $cores = [];
+ foreach ($actualLines as $line) {
+ strtok($line, ',');
+ $core = strtok(',');
+
+ if (false === $core) {
+ continue;
+ }
+
+ $cores[$core] = true;
+ }
+ unset($cores['-']);
+
+ $count = count($cores);
+
+ return 0 === $count ? null : $count;
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php
new file mode 100644
index 0000000..c0f7a6f
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/NProcFinder.php
@@ -0,0 +1,59 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use Fidry\CpuCoreCounter\Executor\ProcessExecutor;
+use function sprintf;
+
+/**
+ * The number of (logical) cores.
+ *
+ * @see https://github.com/infection/infection/blob/fbd8c44/src/Resource/Processor/CpuCoresCountProvider.php#L69-L82
+ * @see https://unix.stackexchange.com/questions/146051/number-of-processors-in-proc-cpuinfo
+ */
+final class NProcFinder extends ProcOpenBasedFinder
+{
+ /**
+ * @var bool
+ */
+ private $all;
+
+ /**
+ * @param bool $all If disabled will give the number of cores available for the current process
+ * only. This is disabled by default as it is known to be "buggy" on virtual
+ * environments as the virtualization tool, e.g. VMWare, might over-commit
+ * resources by default.
+ */
+ public function __construct(
+ bool $all = false,
+ ?ProcessExecutor $executor = null
+ ) {
+ parent::__construct($executor);
+
+ $this->all = $all;
+ }
+
+ public function toString(): string
+ {
+ return sprintf(
+ 'NProcFinder(all=%s)',
+ $this->all ? 'true' : 'false'
+ );
+ }
+
+ protected function getCommand(): string
+ {
+ return 'nproc'.($this->all ? ' --all' : '');
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php
new file mode 100644
index 0000000..9143e31
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/NProcessorFinder.php
@@ -0,0 +1,32 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+/**
+ * Find the number of logical CPU cores for FreeSBD, Solaris and the likes.
+ *
+ * @see https://twitter.com/freebsdfrau/status/1052016199452700678?s=20&t=M2pHkRqmmna-UF68lfL2hw
+ */
+final class NProcessorFinder extends ProcOpenBasedFinder
+{
+ protected function getCommand(): string
+ {
+ return 'getconf NPROCESSORS_ONLN';
+ }
+
+ public function toString(): string
+ {
+ return 'NProcessorFinder';
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php
new file mode 100644
index 0000000..50af2d4
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/NullCpuCoreFinder.php
@@ -0,0 +1,35 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+/**
+ * This finder returns whatever value you gave to it. This is useful for testing.
+ */
+final class NullCpuCoreFinder implements CpuCoreFinder
+{
+ public function diagnose(): string
+ {
+ return 'Will return "null".';
+ }
+
+ public function find(): ?int
+ {
+ return null;
+ }
+
+ public function toString(): string
+ {
+ return 'NullCpuCoreFinder';
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php
new file mode 100644
index 0000000..d36d030
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/OnlyInPowerShellFinder.php
@@ -0,0 +1,62 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function getenv;
+use function sprintf;
+
+final class OnlyInPowerShellFinder implements CpuCoreFinder
+{
+ /**
+ * @var CpuCoreFinder
+ */
+ private $decoratedFinder;
+
+ public function __construct(CpuCoreFinder $decoratedFinder)
+ {
+ $this->decoratedFinder = $decoratedFinder;
+ }
+
+ public function diagnose(): string
+ {
+ $powerShellModulePath = getenv('PSModulePath');
+
+ return $this->skip()
+ ? sprintf(
+ 'Skipped; no power shell module path detected ("%s").',
+ $powerShellModulePath
+ )
+ : $this->decoratedFinder->diagnose();
+ }
+
+ public function find(): ?int
+ {
+ return $this->skip()
+ ? null
+ : $this->decoratedFinder->find();
+ }
+
+ public function toString(): string
+ {
+ return sprintf(
+ 'OnlyInPowerShellFinder(%s)',
+ $this->decoratedFinder->toString()
+ );
+ }
+
+ private function skip(): bool
+ {
+ return false === getenv('PSModulePath');
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php
new file mode 100644
index 0000000..3147808
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/OnlyOnOSFamilyFinder.php
@@ -0,0 +1,113 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function implode;
+use function sprintf;
+use const PHP_OS_FAMILY;
+
+final class OnlyOnOSFamilyFinder implements CpuCoreFinder
+{
+ /**
+ * @var list
+ */
+ private $skippedOSFamilies;
+
+ /**
+ * @var CpuCoreFinder
+ */
+ private $decoratedFinder;
+
+ /**
+ * @param string|list $skippedOSFamilyOrFamilies
+ */
+ public function __construct(
+ $skippedOSFamilyOrFamilies,
+ CpuCoreFinder $decoratedFinder
+ ) {
+ $this->skippedOSFamilies = (array) $skippedOSFamilyOrFamilies;
+ $this->decoratedFinder = $decoratedFinder;
+ }
+
+ public static function forWindows(CpuCoreFinder $decoratedFinder): self
+ {
+ return new self(
+ 'Windows',
+ $decoratedFinder
+ );
+ }
+
+ public static function forBSD(CpuCoreFinder $decoratedFinder): self
+ {
+ return new self(
+ 'BSD',
+ $decoratedFinder
+ );
+ }
+
+ public static function forDarwin(CpuCoreFinder $decoratedFinder): self
+ {
+ return new self(
+ 'Darwin',
+ $decoratedFinder
+ );
+ }
+
+ public static function forSolaris(CpuCoreFinder $decoratedFinder): self
+ {
+ return new self(
+ 'Solaris',
+ $decoratedFinder
+ );
+ }
+
+ public static function forLinux(CpuCoreFinder $decoratedFinder): self
+ {
+ return new self(
+ 'Linux',
+ $decoratedFinder
+ );
+ }
+
+ public function diagnose(): string
+ {
+ return $this->skip()
+ ? sprintf(
+ 'Skipped platform detected ("%s").',
+ PHP_OS_FAMILY
+ )
+ : $this->decoratedFinder->diagnose();
+ }
+
+ public function find(): ?int
+ {
+ return $this->skip()
+ ? null
+ : $this->decoratedFinder->find();
+ }
+
+ public function toString(): string
+ {
+ return sprintf(
+ 'OnlyOnOSFamilyFinder(only=(%s),%s)',
+ implode(',', $this->skippedOSFamilies),
+ $this->decoratedFinder->toString()
+ );
+ }
+
+ private function skip(): bool
+ {
+ return !in_array(PHP_OS_FAMILY, $this->skippedOSFamilies, true);
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php
new file mode 100644
index 0000000..4d51f89
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/ProcOpenBasedFinder.php
@@ -0,0 +1,107 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use Fidry\CpuCoreCounter\Executor\ProcessExecutor;
+use Fidry\CpuCoreCounter\Executor\ProcOpenExecutor;
+use function filter_var;
+use function function_exists;
+use function is_int;
+use function sprintf;
+use function trim;
+use const FILTER_VALIDATE_INT;
+use const PHP_EOL;
+
+abstract class ProcOpenBasedFinder implements CpuCoreFinder
+{
+ /**
+ * @var ProcessExecutor
+ */
+ private $executor;
+
+ public function __construct(?ProcessExecutor $executor = null)
+ {
+ $this->executor = $executor ?? new ProcOpenExecutor();
+ }
+
+ public function diagnose(): string
+ {
+ if (!function_exists('proc_open')) {
+ return 'The function "proc_open" is not available.';
+ }
+
+ $command = $this->getCommand();
+ $output = $this->executor->execute($command);
+
+ if (null === $output) {
+ return sprintf(
+ 'Failed to execute the command "%s".',
+ $command
+ );
+ }
+
+ [$stdout, $stderr] = $output;
+ $failed = '' !== trim($stderr);
+
+ return $failed
+ ? sprintf(
+ 'Executed the command "%s" which wrote the following output to the STDERR:%s%s%sWill return "null".',
+ $command,
+ PHP_EOL,
+ $stderr,
+ PHP_EOL
+ )
+ : sprintf(
+ 'Executed the command "%s" and got the following (STDOUT) output:%s%s%sWill return "%s".',
+ $command,
+ PHP_EOL,
+ $stdout,
+ PHP_EOL,
+ $this->countCpuCores($stdout) ?? 'null'
+ );
+ }
+
+ /**
+ * @return positive-int|null
+ */
+ public function find(): ?int
+ {
+ $output = $this->executor->execute($this->getCommand());
+
+ if (null === $output) {
+ return null;
+ }
+
+ [$stdout, $stderr] = $output;
+ $failed = '' !== trim($stderr);
+
+ return $failed
+ ? null
+ : $this->countCpuCores($stdout);
+ }
+
+ /**
+ * @internal
+ *
+ * @return positive-int|null
+ */
+ protected function countCpuCores(string $process): ?int
+ {
+ $cpuCount = filter_var($process, FILTER_VALIDATE_INT);
+
+ return is_int($cpuCount) && $cpuCount > 0 ? $cpuCount : null;
+ }
+
+ abstract protected function getCommand(): string;
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php
new file mode 100644
index 0000000..66a5016
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/SkipOnOSFamilyFinder.php
@@ -0,0 +1,113 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function implode;
+use function in_array;
+use function sprintf;
+
+final class SkipOnOSFamilyFinder implements CpuCoreFinder
+{
+ /**
+ * @var list
+ */
+ private $skippedOSFamilies;
+
+ /**
+ * @var CpuCoreFinder
+ */
+ private $decoratedFinder;
+
+ /**
+ * @param string|list $skippedOSFamilyOrFamilies
+ */
+ public function __construct(
+ $skippedOSFamilyOrFamilies,
+ CpuCoreFinder $decoratedFinder
+ ) {
+ $this->skippedOSFamilies = (array) $skippedOSFamilyOrFamilies;
+ $this->decoratedFinder = $decoratedFinder;
+ }
+
+ public static function forWindows(CpuCoreFinder $decoratedFinder): self
+ {
+ return new self(
+ 'Windows',
+ $decoratedFinder
+ );
+ }
+
+ public static function forBSD(CpuCoreFinder $decoratedFinder): self
+ {
+ return new self(
+ 'BSD',
+ $decoratedFinder
+ );
+ }
+
+ public static function forDarwin(CpuCoreFinder $decoratedFinder): self
+ {
+ return new self(
+ 'Darwin',
+ $decoratedFinder
+ );
+ }
+
+ public static function forSolaris(CpuCoreFinder $decoratedFinder): self
+ {
+ return new self(
+ 'Solaris',
+ $decoratedFinder
+ );
+ }
+
+ public static function forLinux(CpuCoreFinder $decoratedFinder): self
+ {
+ return new self(
+ 'Linux',
+ $decoratedFinder
+ );
+ }
+
+ public function diagnose(): string
+ {
+ return $this->skip()
+ ? sprintf(
+ 'Skipped platform detected ("%s").',
+ PHP_OS_FAMILY
+ )
+ : $this->decoratedFinder->diagnose();
+ }
+
+ public function find(): ?int
+ {
+ return $this->skip()
+ ? null
+ : $this->decoratedFinder->find();
+ }
+
+ public function toString(): string
+ {
+ return sprintf(
+ 'SkipOnOSFamilyFinder(skip=(%s),%s)',
+ implode(',', $this->skippedOSFamilies),
+ $this->decoratedFinder->toString()
+ );
+ }
+
+ private function skip(): bool
+ {
+ return in_array(PHP_OS_FAMILY, $this->skippedOSFamilies, true);
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php
new file mode 100644
index 0000000..b223652
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php
@@ -0,0 +1,51 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function array_filter;
+use function count;
+use function explode;
+use const PHP_EOL;
+
+/**
+ * Find the number of logical CPU cores for Windows.
+ *
+ * @see https://knowledge.informatica.com/s/article/151521
+ */
+final class WindowsRegistryLogicalFinder extends ProcOpenBasedFinder
+{
+ protected function getCommand(): string
+ {
+ return 'reg query HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor';
+ }
+
+ public function toString(): string
+ {
+ return 'WindowsRegistryLogicalFinder';
+ }
+
+ protected function countCpuCores(string $process): ?int
+ {
+ $count = count(
+ array_filter(
+ explode(PHP_EOL, $process),
+ static function (string $line): bool {
+ return '' !== trim($line);
+ }
+ )
+ );
+
+ return $count > 0 ? $count : null;
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php
new file mode 100644
index 0000000..0beb21e
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/WmicLogicalFinder.php
@@ -0,0 +1,48 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function preg_match;
+
+/**
+ * Find the number of logical CPU cores for Windows.
+ *
+ * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L912-L916
+ */
+final class WmicLogicalFinder extends ProcOpenBasedFinder
+{
+ private const CPU_CORE_COUNT_REGEX = '/NumberOfLogicalProcessors[\s\n]+(?\d+)/';
+
+ protected function getCommand(): string
+ {
+ return 'wmic cpu get NumberOfLogicalProcessors';
+ }
+
+ public function toString(): string
+ {
+ return 'WmicLogicalFinder';
+ }
+
+ protected function countCpuCores(string $process): ?int
+ {
+ if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) {
+ return parent::countCpuCores($process);
+ }
+
+ /** @phpstan-ignore offsetAccess.notFound */
+ $count = $matches['count'];
+
+ return parent::countCpuCores($count);
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php
new file mode 100644
index 0000000..04abdc5
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/WmicPhysicalFinder.php
@@ -0,0 +1,48 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+use function preg_match;
+
+/**
+ * Find the number of physical CPU cores for Windows.
+ *
+ * @see https://github.com/paratestphp/paratest/blob/c163539818fd96308ca8dc60f46088461e366ed4/src/Runners/PHPUnit/Options.php#L912-L916
+ */
+final class WmicPhysicalFinder extends ProcOpenBasedFinder
+{
+ private const CPU_CORE_COUNT_REGEX = '/NumberOfCores[\s\n]+(?\d+)/';
+
+ protected function getCommand(): string
+ {
+ return 'wmic cpu get NumberOfCores';
+ }
+
+ public function toString(): string
+ {
+ return 'WmicPhysicalFinder';
+ }
+
+ protected function countCpuCores(string $process): ?int
+ {
+ if (0 === preg_match(self::CPU_CORE_COUNT_REGEX, $process, $matches)) {
+ return parent::countCpuCores($process);
+ }
+
+ /** @phpstan-ignore offsetAccess.notFound */
+ $count = $matches['count'];
+
+ return parent::countCpuCores($count);
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php
new file mode 100644
index 0000000..23f452e
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/Finder/_NProcessorFinder.php
@@ -0,0 +1,32 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter\Finder;
+
+/**
+ * Find the number of logical CPU cores for Linux and the likes.
+ *
+ * @see https://twitter.com/freebsdfrau/status/1052016199452700678?s=20&t=M2pHkRqmmna-UF68lfL2hw
+ */
+final class _NProcessorFinder extends ProcOpenBasedFinder
+{
+ protected function getCommand(): string
+ {
+ return 'getconf _NPROCESSORS_ONLN';
+ }
+
+ public function toString(): string
+ {
+ return '_NProcessorFinder';
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php
new file mode 100644
index 0000000..e54f893
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/NumberOfCpuCoreNotFound.php
@@ -0,0 +1,26 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter;
+
+use RuntimeException;
+
+final class NumberOfCpuCoreNotFound extends RuntimeException
+{
+ public static function create(): self
+ {
+ return new self(
+ 'Could not find the number of CPU cores available.'
+ );
+ }
+}
diff --git a/trilhas_poo/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php b/trilhas_poo/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php
new file mode 100644
index 0000000..1f29434
--- /dev/null
+++ b/trilhas_poo/vendor/fidry/cpu-core-counter/src/ParallelisationResult.php
@@ -0,0 +1,87 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+declare(strict_types=1);
+
+namespace Fidry\CpuCoreCounter;
+
+/**
+ * @readonly
+ */
+final class ParallelisationResult
+{
+ /**
+ * @var positive-int|0
+ */
+ public $passedReservedCpus;
+
+ /**
+ * @var non-zero-int|null
+ */
+ public $passedCountLimit;
+
+ /**
+ * @var float|null
+ */
+ public $passedLoadLimit;
+
+ /**
+ * @var float|null
+ */
+ public $passedSystemLoadAverage;
+
+ /**
+ * @var non-zero-int|null
+ */
+ public $correctedCountLimit;
+
+ /**
+ * @var float|null
+ */
+ public $correctedSystemLoadAverage;
+
+ /**
+ * @var positive-int
+ */
+ public $totalCoresCount;
+
+ /**
+ * @var positive-int
+ */
+ public $availableCpus;
+
+ /**
+ * @param positive-int|0 $passedReservedCpus
+ * @param non-zero-int|null $passedCountLimit
+ * @param non-zero-int|null $correctedCountLimit
+ * @param positive-int $totalCoresCount
+ * @param positive-int $availableCpus
+ */
+ public function __construct(
+ int $passedReservedCpus,
+ ?int $passedCountLimit,
+ ?float $passedLoadLimit,
+ ?float $passedSystemLoadAverage,
+ ?int $correctedCountLimit,
+ ?float $correctedSystemLoadAverage,
+ int $totalCoresCount,
+ int $availableCpus
+ ) {
+ $this->passedReservedCpus = $passedReservedCpus;
+ $this->passedCountLimit = $passedCountLimit;
+ $this->passedLoadLimit = $passedLoadLimit;
+ $this->passedSystemLoadAverage = $passedSystemLoadAverage;
+ $this->correctedCountLimit = $correctedCountLimit;
+ $this->correctedSystemLoadAverage = $correctedSystemLoadAverage;
+ $this->totalCoresCount = $totalCoresCount;
+ $this->availableCpus = $availableCpus;
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/LICENSE b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/LICENSE
new file mode 100644
index 0000000..871def0
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2012+ Fabien Potencier, Dariusz Rumiński
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/README.md b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/README.md
new file mode 100644
index 0000000..c5a5df8
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/README.md
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+# PHP Coding Standards Fixer
+
+The PHP Coding Standards Fixer (PHP CS Fixer) fixes your code to follow the standards.
+
+If you are already using a linter to identify coding standards problems in your
+code, you know that fixing them by hand is tedious, especially on large
+projects. This tool not only detects them, but also fixes them for you.
+
+PHP CS Fixer has built-in rule sets, whether you want to follow PHP coding standards as defined by [PHP-FIG's PER Coding Style](https://www.php-fig.org/per/coding-style/) - [`@PER-CS`](./doc/ruleSets/PER-CS.rst),
+a wide community like the [Symfony](https://symfony.com/doc/current/contributing/code/standards.html) - [`@Symfony`](./doc/ruleSets/Symfony.rst),
+or our opinionated one - [@PhpCsFixer](./doc/ruleSets/PhpCsFixer.rst).
+You can also define your (team's) style through the [configuration file](./doc/config.rst).
+
+PHP CS Fixer can not only unify the style of your code, but also help to modernise your codebase towards
+newer PHP (e.g. [`@autoPHPMigration`](./doc/ruleSets/AutoPHPMigration.rst) and [`@autoPHPMigration:risky`](./doc/ruleSets/AutoPHPMigrationRisky.rst)) and newer PHPUnit (e.g. [`@autoPHPUnitMigration:risky`](./doc/ruleSets/AutoPHPUnitMigrationRisky.rst)).
+
+There are also [`@auto`](./doc/ruleSets/Auto.rst) and [`@auto:risky`](./doc/ruleSets/AutoRisky.rst) that aim to provide good base rules.
+
+## Supported PHP Versions
+
+* PHP 7.4 - PHP 8.5
+
+> [!NOTE]
+> Each new PHP version requires a huge effort to support the new syntax.
+> That's why the latest PHP version might not be supported yet. If you need it,
+> please consider supporting the project in any convenient way, for example,
+> with code contributions or reviewing existing PRs. To run PHP CS Fixer on yet
+> unsupported versions "at your own risk" - use `--allow-unsupported-php-version=yes` option.
+
+## Documentation
+
+### Installation
+
+The recommended way to install PHP CS Fixer is to use [Composer](https://getcomposer.org/download/):
+
+```sh
+composer require --dev friendsofphp/php-cs-fixer
+## or when facing conflicts in dependencies:
+composer require --dev php-cs-fixer/shim
+```
+
+For more details and other installation methods (also with Docker or behind CI), see
+[installation instructions](./doc/installation.rst).
+
+### Usage
+
+Assuming you installed PHP CS Fixer as instructed above, you can
+initialise base config for your project by using following command:
+
+```sh
+./vendor/bin/php-cs-fixer init
+```
+
+To automatically fix your project, or only check against the need of changes, run:
+
+```sh
+./vendor/bin/php-cs-fixer fix
+./vendor/bin/php-cs-fixer check
+```
+
+See [usage](./doc/usage.rst), list of [built-in rules](./doc/rules/index.rst), list of [rule sets](./doc/ruleSets/index.rst)
+and [configuration file](./doc/config.rst) documentation for more details.
+
+If you need to apply code styles that are not built-in into the tool, you can
+[create custom rules](./doc/custom_rules.rst).
+
+## Editor Integration
+
+Native support exists for:
+
+* [PhpStorm](https://www.jetbrains.com/help/phpstorm/using-php-cs-fixer.html)
+
+Community plugins exist for:
+
+* [NetBeans](https://plugins.netbeans.apache.org/catalogue/?id=36)
+* [Sublime Text](https://github.com/benmatselby/sublime-phpcs)
+* [Vim](https://github.com/stephpy/vim-php-cs-fixer)
+* [VS Code](https://github.com/junstyle/vscode-php-cs-fixer)
+
+## Community
+
+The PHP CS Fixer is maintained on GitHub at .
+Contributions, bug reports and ideas about new features are welcome there.
+
+You can reach us in the [GitHub Discussions](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/) regarding the
+project, configuration, possible improvements, ideas and questions.
+
+## Contribute
+
+The tool comes with quite a few built-in fixers, but everyone is more than
+welcome to [contribute](./CONTRIBUTING.md) more of them.
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/composer.json b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/composer.json
new file mode 100644
index 0000000..7e59768
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/composer.json
@@ -0,0 +1,220 @@
+{
+ "name": "friendsofphp/php-cs-fixer",
+ "description": "A tool to automatically fix PHP code style",
+ "license": "MIT",
+ "type": "application",
+ "keywords": [
+ "fixer",
+ "standards",
+ "static analysis",
+ "static code analysis"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Dariusz Rumiński",
+ "email": "dariusz.ruminski@gmail.com"
+ }
+ ],
+ "require": {
+ "php": "^7.4 || ^8.0",
+ "ext-filter": "*",
+ "ext-hash": "*",
+ "ext-json": "*",
+ "ext-tokenizer": "*",
+ "clue/ndjson-react": "^1.3",
+ "composer/semver": "^3.4",
+ "composer/xdebug-handler": "^3.0.5",
+ "ergebnis/agent-detector": "^1.2",
+ "fidry/cpu-core-counter": "^1.3",
+ "react/child-process": "^0.6.6",
+ "react/event-loop": "^1.5",
+ "react/socket": "^1.16",
+ "react/stream": "^1.4",
+ "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0 || ^8.0 || ^9.0",
+ "symfony/console": "^5.4.47 || ^6.4.24 || ^7.0 || ^8.0",
+ "symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
+ "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
+ "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
+ "symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
+ "symfony/polyfill-mbstring": "^1.37",
+ "symfony/polyfill-php80": "^1.37",
+ "symfony/polyfill-php81": "^1.37",
+ "symfony/polyfill-php84": "^1.37",
+ "symfony/process": "^5.4.47 || ^6.4.24 || ^7.2 || ^8.0",
+ "symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "facile-it/paraunit": "^1.3.1 || ^2.11.0",
+ "infection/infection": "^0.32.7",
+ "justinrainbow/json-schema": "^6.10.0",
+ "keradus/cli-executor": "^2.3",
+ "mikey179/vfsstream": "^1.6.12",
+ "php-coveralls/php-coveralls": "^2.9.1",
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.8",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.8",
+ "phpunit/phpunit": "^9.6.35 || ^10.5.64 || ^11.5.56 || ^12.5.31",
+ "symfony/polyfill-php85": "^1.38",
+ "symfony/var-dumper": "^5.4.48 || ^6.4.36 || ^7.4.8 || ^8.1.0",
+ "symfony/yaml": "^5.4.53 || ^6.4.41 || ^7.4.13 || ^8.1.0"
+ },
+ "suggest": {
+ "ext-dom": "For handling output formats in XML",
+ "ext-mbstring": "For handling non-UTF8 characters."
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpCsFixer\\": "src/"
+ },
+ "exclude-from-classmap": [
+ "src/**/Internal/"
+ ]
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "PhpCsFixer\\PHPStan\\": "dev-tools/phpstan/src/",
+ "PhpCsFixer\\Tests\\": "tests/"
+ },
+ "exclude-from-classmap": [
+ "tests/Fixtures/"
+ ]
+ },
+ "bin": [
+ "php-cs-fixer"
+ ],
+ "config": {
+ "allow-plugins": {
+ "ergebnis/composer-normalize": true,
+ "infection/extension-installer": false
+ },
+ "prefer-stable": true,
+ "sort-packages": true
+ },
+ "scripts": {
+ "post-autoload-dump": [
+ "@install-tools"
+ ],
+ "analyse-deps": "@php dev-tools/vendor/bin/composer-dependency-analyser",
+ "auto-review": [
+ "Composer\\Config::disableProcessTimeout",
+ "@php ./vendor/bin/paraunit run --testsuite auto-review"
+ ],
+ "cs:check": "@php php-cs-fixer check --verbose --diff",
+ "cs:fix": "@php php-cs-fixer fix",
+ "cs:fix:parallel": [
+ "echo '⚠️ This script is deprecated! Utilise built-in parallelisation instead.';",
+ "@cs:fix"
+ ],
+ "docs": "@php dev-tools/php-cs-fixer-internal docs",
+ "infection": "@test:mutation",
+ "install-tools": [
+ "./dev-tools/install.sh",
+ "@composer install --working-dir=dev-tools"
+ ],
+ "internal": "@php dev-tools/php-cs-fixer-internal",
+ "mess-detector": "@php dev-tools/vendor/bin/phpmd . ansi dev-tools/mess-detector/phpmd.xml --exclude vendor/*,dev-tools/vendor/*,dev-tools/phpstan/*,tests/Fixtures/*",
+ "normalize": [
+ "@composer normalize --working-dir=dev-tools --dry-run ../composer.json",
+ "@composer normalize --working-dir=dev-tools --dry-run composer.json"
+ ],
+ "normalize:fix": [
+ "@composer normalize --working-dir=dev-tools ../composer.json",
+ "@composer normalize --working-dir=dev-tools composer.json"
+ ],
+ "php-compatibility": "@php dev-tools/vendor/bin/phpcs -p --standard=dev-tools/php-compatibility/phpcs-php-compatibility.xml",
+ "phpstan": "@php -d memory_limit=512M dev-tools/vendor/bin/phpstan analyse",
+ "phpstan:baseline": [
+ "@php -d memory_limit=512M dev-tools/vendor/bin/phpstan analyse --generate-baseline=./dev-tools/phpstan/baseline/_loader.php",
+ "@php dev-tools/vendor/bin/split-phpstan-baseline ./dev-tools/phpstan/baseline/_loader.php --no-error-count"
+ ],
+ "qa": "@quality-assurance",
+ "quality-assurance": [
+ "Composer\\Config::disableProcessTimeout",
+ "@install-tools --quiet",
+ "@self-check",
+ "@static-analysis",
+ "@test"
+ ],
+ "sa": "@static-analysis",
+ "self-check": [
+ "./dev-tools/check_file_permissions.sh",
+ "./dev-tools/check_trailing_spaces.sh",
+ "./dev-tools/check_shell_scripts.sh",
+ "./dev-tools/check_no_american_english.sh",
+ "@composer dump-autoload --dry-run --optimize --strict-psr",
+ "@normalize",
+ "@analyse-deps",
+ "@auto-review"
+ ],
+ "static-analysis": [
+ "@cs:check",
+ "@phpstan",
+ "@php-compatibility",
+ "@mess-detector"
+ ],
+ "test": "@test:all",
+ "test:all": [
+ "@test:unit",
+ "@test:short-open-tag",
+ "@test:integration"
+ ],
+ "test:coverage": [
+ "Composer\\Config::disableProcessTimeout",
+ "@composer show facile-it/paraunit ^2 && (paraunit coverage --testsuite unit --pass-through=--exclude-group=covers-nothing --pass-through=--do-not-fail-on-empty-test-suite) || (paraunit coverage --testsuite unit --exclude-group covers-nothing)"
+ ],
+ "test:integration": [
+ "Composer\\Config::disableProcessTimeout",
+ "@php ./vendor/bin/paraunit run --testsuite integration"
+ ],
+ "test:mutation": [
+ "Composer\\Config::disableProcessTimeout",
+ "infection --threads=max --only-covering-test-cases --min-covered-msi=80"
+ ],
+ "test:short-open-tag": [
+ "Composer\\Config::disableProcessTimeout",
+ "@php -d short_open_tag=1 ./vendor/bin/phpunit --do-not-cache-result --testsuite short-open-tag"
+ ],
+ "test:smoke": [
+ "Composer\\Config::disableProcessTimeout",
+ "@php ./vendor/bin/paraunit run --testsuite smoke"
+ ],
+ "test:unit": [
+ "Composer\\Config::disableProcessTimeout",
+ "@php ./vendor/bin/paraunit run --testsuite unit"
+ ]
+ },
+ "scripts-descriptions": {
+ "analyse-deps": "Analyse Composer dependencies",
+ "auto-review": "Execute Auto-review",
+ "cs:check": "Check coding standards",
+ "cs:fix": "Fix coding standards",
+ "cs:fix:parallel": "⚠️DEPRECATED! Use cs:fix with proper parallel config",
+ "docs": "Regenerate docs",
+ "infection": "Alias for 'test:mutation'",
+ "install-tools": "Install DEV tools",
+ "internal": "Run internal commands",
+ "mess-detector": "Analyse code with Mess Detector",
+ "normalize": "Check normalization for composer.json files",
+ "normalize:fix": "Run normalization for composer.json files",
+ "php-compatibility": "Check compatibility with all supported PHP versions",
+ "phpstan": "Run PHPStan analysis",
+ "phpstan:baseline": "Dump PHPStan baseline file - use only for updating, do not add new errors when possible",
+ "post-autoload-dump": "Run additional tasks after installing/updating main dependencies",
+ "qa": "Alias for 'quality-assurance'",
+ "quality-assurance": "Run QA suite",
+ "sa": "Alias for 'static-analysis'",
+ "self-check": "Run set of self-checks ensuring repository's validity",
+ "static-analysis": "Run static analysis",
+ "test": "Alias for 'test:all'",
+ "test:all": "Run Unit and Integration tests (but *NOT* Smoke tests)",
+ "test:coverage": "Run tests that provide code coverage",
+ "test:integration": "Run Integration tests",
+ "test:mutation": "Run mutation tests",
+ "test:short-open-tag": "Run tests with \"short_open_tag\" enabled",
+ "test:smoke": "Run Smoke tests",
+ "test:unit": "Run Unit tests"
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/php-cs-fixer b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
new file mode 100755
index 0000000..89db199
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/php-cs-fixer
@@ -0,0 +1,112 @@
+#!/usr/bin/env php
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use Composer\XdebugHandler\XdebugHandler;
+use PhpCsFixer\Console\Application;
+
+error_reporting(\E_ALL & ~\E_DEPRECATED & ~\E_USER_DEPRECATED);
+
+set_error_handler(static function (int $severity, string $message, string $file, int $line): bool {
+ if (0 !== ($severity & error_reporting())) {
+ throw new \ErrorException($message, 0, $severity, $file, $line);
+ }
+
+ return true;
+});
+
+// check environment requirements
+(static function (): void {
+ if (\PHP_VERSION_ID === (int) '80000') { // TODO use 8_00_00 once only PHP 7.4+ is supported by this entry file
+ fwrite(\STDERR, "PHP CS Fixer is not able run on PHP 8.0.0 due to bug in PHP tokenizer (https://bugs.php.net/bug.php?id=80462).\n");
+ fwrite(\STDERR, "Update PHP version to unblock execution.\n");
+
+ exit(1);
+ }
+
+ // PHPStan knows our min PHP version, but we want to check the min version here
+ // because entrypoint file allows wider PHP range than project itself
+ // @phpstan-ignore smaller.alwaysFalse
+ if (\PHP_VERSION_ID < (int) '70400') {
+ fwrite(\STDERR, "PHP needs to be a minimum version of PHP 7.4.0.\n");
+ fwrite(\STDERR, 'Current PHP version: '.\PHP_VERSION.".\n");
+
+ exit(1);
+ }
+
+ // @TODO 4.0 cleanup
+ if (false !== getenv('PHP_CS_FIXER_IGNORE_ENV')) {
+ fwrite(\STDERR, "Setting PHP_CS_FIXER_IGNORE_ENV environment variable is deprecated and will be removed in 4.0, use unsupportedPhpVersionAllowed config instead.\n");
+ }
+
+ foreach (['json', 'tokenizer'] as $extension) {
+ if (!\extension_loaded($extension)) {
+ fwrite(\STDERR, \sprintf("PHP extension ext-%s is missing from your system. Install or enable it.\n", $extension));
+
+ if (filter_var(getenv('PHP_CS_FIXER_IGNORE_ENV'), \FILTER_VALIDATE_BOOLEAN)) {
+ fwrite(\STDERR, "Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.\n");
+ } else {
+ exit(1);
+ }
+ }
+ }
+})();
+
+// load dependencies
+(static function (): void {
+ $require = true;
+ if (class_exists(\Phar::class)) {
+ // Maybe this file is used as phar-stub? Let's try!
+ try {
+ \Phar::mapPhar('php-cs-fixer.phar');
+
+ /** @phpstan-ignore requireOnce.fileNotFound */
+ require_once 'phar://php-cs-fixer.phar/vendor/autoload.php';
+
+ $require = false;
+ } catch (\PharException $e) {
+ }
+ }
+
+ if ($require) {
+ // OK, it's not, let give Composer autoloader a try!
+ $possibleFiles = [__DIR__.'/../../autoload.php', __DIR__.'/../autoload.php', __DIR__.'/vendor/autoload.php'];
+ $file = null;
+ foreach ($possibleFiles as $possibleFile) {
+ if (file_exists($possibleFile)) {
+ $file = $possibleFile;
+
+ break;
+ }
+ }
+
+ if (null === $file) {
+ throw new \RuntimeException('Unable to locate autoload.php file.');
+ }
+
+ require_once $file;
+ }
+})();
+
+// Restart if xdebug is loaded, unless the environment variable PHP_CS_FIXER_ALLOW_XDEBUG is set.
+$xdebug = new XdebugHandler('PHP_CS_FIXER');
+$xdebug->check();
+unset($xdebug);
+
+$application = new Application();
+$application->run();
+
+__HALT_COMPILER();
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/resources/.php-cs-fixer.dist.php.template b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/resources/.php-cs-fixer.dist.php.template
new file mode 100644
index 0000000..bdd3711
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/resources/.php-cs-fixer.dist.php.template
@@ -0,0 +1,26 @@
+setRiskyAllowed(/*{{ IS_RISKY_ALLOWED }}*/)
+ ->setRules(/*{{ RULES }}*/)
+ // 💡 by default, Fixer looks for `*.php` files excluding `./vendor/` - here, you can groom this config
+ ->setFinder(
+ (new Finder())
+ // 💡 root folder to check
+ ->in(__DIR__)
+ // 💡 additional files, eg bin entry file
+ // ->append([__DIR__.'/bin-entry-file'])
+ // 💡 folders to exclude, if any
+ // ->exclude([/* ... */])
+ // 💡 path patterns to exclude, if any
+ // ->notPath([/* ... */])
+ // 💡 extra configs
+ // ->ignoreDotFiles(false) // true by default in v3, false in v4 or future mode
+ // ->ignoreVCS(true) // true by default
+ )
+;
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php
new file mode 100644
index 0000000..c96ff54
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractDoctrineAnnotationFixer.php
@@ -0,0 +1,228 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use PhpCsFixer\Doctrine\Annotation\Tokens as DoctrineAnnotationTokens;
+use PhpCsFixer\Fixer\ConfigurableFixerInterface;
+use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
+use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
+use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
+use PhpCsFixer\Tokenizer\CT;
+use PhpCsFixer\Tokenizer\FCT;
+use PhpCsFixer\Tokenizer\Token;
+use PhpCsFixer\Tokenizer\Tokens;
+use PhpCsFixer\Tokenizer\TokensAnalyzer;
+
+/**
+ * @internal
+ *
+ * @phpstan-type _AutogeneratedInputConfiguration array{
+ * ignored_tags?: list,
+ * }
+ * @phpstan-type _AutogeneratedComputedConfiguration array{
+ * ignored_tags: list,
+ * }
+ *
+ * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+abstract class AbstractDoctrineAnnotationFixer extends AbstractFixer implements ConfigurableFixerInterface
+{
+ private const CLASS_MODIFIERS = [\T_ABSTRACT, \T_FINAL, FCT::T_READONLY];
+ private const MODIFIER_KINDS = [\T_PUBLIC, \T_PROTECTED, \T_PRIVATE, \T_FINAL, \T_ABSTRACT, \T_NS_SEPARATOR, \T_STRING, CT::T_NULLABLE_TYPE, FCT::T_READONLY, FCT::T_PRIVATE_SET, FCT::T_PROTECTED_SET, FCT::T_PUBLIC_SET];
+
+ /**
+ * @var array
+ */
+ private array $classyElements;
+
+ public function isCandidate(Tokens $tokens): bool
+ {
+ return $tokens->isTokenKindFound(\T_DOC_COMMENT);
+ }
+
+ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
+ {
+ // fetch indices one time, this is safe as we never add or remove a token during fixing
+ $analyzer = new TokensAnalyzer($tokens);
+ $this->classyElements = $analyzer->getClassyElements();
+
+ foreach ($tokens->findGivenKind(\T_DOC_COMMENT) as $index => $docCommentToken) {
+ if (!$this->nextElementAcceptsDoctrineAnnotations($tokens, $index)) {
+ continue;
+ }
+
+ $doctrineAnnotationTokens = DoctrineAnnotationTokens::createFromDocComment(
+ $docCommentToken,
+ $this->configuration['ignored_tags'], // @phpstan-ignore-line
+ );
+
+ $this->fixAnnotations($doctrineAnnotationTokens);
+ $tokens[$index] = new Token([\T_DOC_COMMENT, $doctrineAnnotationTokens->getCode()]);
+ }
+ }
+
+ /**
+ * Fixes Doctrine annotations from the given PHPDoc style comment.
+ */
+ abstract protected function fixAnnotations(DoctrineAnnotationTokens $doctrineAnnotationTokens): void;
+
+ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
+ {
+ return new FixerConfigurationResolver([
+ (new FixerOptionBuilder('ignored_tags', 'List of tags that must not be treated as Doctrine Annotations.'))
+ ->setAllowedTypes(['string[]'])
+ ->setDefault([
+ // PHPDocumentor 1
+ 'abstract',
+ 'access',
+ 'code',
+ 'deprec',
+ 'encode',
+ 'exception',
+ 'final',
+ 'ingroup',
+ 'inheritdoc',
+ 'inheritDoc',
+ 'magic',
+ 'name',
+ 'toc',
+ 'tutorial',
+ 'private',
+ 'static',
+ 'staticvar',
+ 'staticVar',
+ 'throw',
+
+ // PHPDocumentor 2
+ 'api',
+ 'author',
+ 'category',
+ 'copyright',
+ 'deprecated',
+ 'example',
+ 'filesource',
+ 'global',
+ 'ignore',
+ 'internal',
+ 'license',
+ 'link',
+ 'method',
+ 'package',
+ 'param',
+ 'property',
+ 'property-read',
+ 'property-write',
+ 'return',
+ 'see',
+ 'since',
+ 'source',
+ 'subpackage',
+ 'throws',
+ 'todo',
+ 'TODO',
+ 'usedBy',
+ 'uses',
+ 'var',
+ 'version',
+
+ // PHPUnit
+ 'after',
+ 'afterClass',
+ 'backupGlobals',
+ 'backupStaticAttributes',
+ 'before',
+ 'beforeClass',
+ 'codeCoverageIgnore',
+ 'codeCoverageIgnoreStart',
+ 'codeCoverageIgnoreEnd',
+ 'covers',
+ 'coversDefaultClass',
+ 'coversNothing',
+ 'dataProvider',
+ 'depends',
+ 'expectedException',
+ 'expectedExceptionCode',
+ 'expectedExceptionMessage',
+ 'expectedExceptionMessageRegExp',
+ 'group',
+ 'large',
+ 'medium',
+ 'preserveGlobalState',
+ 'requires',
+ 'runTestsInSeparateProcesses',
+ 'runInSeparateProcess',
+ 'small',
+ 'test',
+ 'testdox',
+ 'ticket',
+ 'uses',
+
+ // PHPCheckStyle
+ 'SuppressWarnings',
+
+ // PHPStorm
+ 'noinspection',
+
+ // PEAR
+ 'package_version',
+
+ // PlantUML
+ 'enduml',
+ 'startuml',
+
+ // Psalm
+ 'psalm',
+
+ // PHPStan
+ 'phpstan',
+ 'template',
+
+ // other
+ 'fix',
+ 'FIXME',
+ 'fixme',
+ 'override',
+ ])
+ ->getOption(),
+ ]);
+ }
+
+ private function nextElementAcceptsDoctrineAnnotations(Tokens $tokens, int $index): bool
+ {
+ do {
+ $index = $tokens->getNextMeaningfulToken($index);
+
+ if (null === $index) {
+ return false;
+ }
+ } while ($tokens[$index]->isGivenKind(self::CLASS_MODIFIERS));
+
+ if ($tokens[$index]->isGivenKind(\T_CLASS)) {
+ return true;
+ }
+
+ while ($tokens[$index]->isGivenKind(self::MODIFIER_KINDS)) {
+ $index = $tokens->getNextMeaningfulToken($index);
+ }
+
+ if (!isset($this->classyElements[$index])) {
+ return false;
+ }
+
+ return $tokens[$this->classyElements[$index]['classIndex']]->isGivenKind(\T_CLASS); // interface, enums and traits cannot have doctrine annotations
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php
new file mode 100644
index 0000000..0a40386
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractFixer.php
@@ -0,0 +1,110 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use PhpCsFixer\ConfigurationException\RequiredFixerConfigurationException;
+use PhpCsFixer\Fixer\ConfigurableFixerInterface;
+use PhpCsFixer\Fixer\FixerInterface;
+use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
+use PhpCsFixer\Tokenizer\Tokens;
+
+/**
+ * @author Dariusz Rumiński
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+abstract class AbstractFixer implements FixerInterface
+{
+ protected WhitespacesFixerConfig $whitespacesConfig;
+
+ /**
+ * @readonly
+ */
+ private string $name;
+
+ public function __construct()
+ {
+ $nameParts = explode('\\', static::class);
+ $name = substr(end($nameParts), 0, -\strlen('Fixer'));
+ $this->name = Utils::camelCaseToUnderscore($name);
+
+ if ($this instanceof ConfigurableFixerInterface) {
+ try {
+ $this->configure([]);
+ } catch (RequiredFixerConfigurationException $e) {
+ // ignore
+ }
+ }
+
+ if ($this instanceof WhitespacesAwareFixerInterface) {
+ $this->whitespacesConfig = $this->getDefaultWhitespacesFixerConfig();
+ }
+ }
+
+ final public function fix(\SplFileInfo $file, Tokens $tokens): void
+ {
+ if ($this instanceof ConfigurableFixerInterface && property_exists($this, 'configuration') && null === $this->configuration) {
+ throw new RequiredFixerConfigurationException($this->getName(), 'Configuration is required.');
+ }
+
+ if (0 < $tokens->count() && $this->isCandidate($tokens) && $this->supports($file)) {
+ $this->applyFix($file, $tokens);
+ }
+ }
+
+ public function isRisky(): bool
+ {
+ return false;
+ }
+
+ public function getName(): string
+ {
+ return $this->name;
+ }
+
+ public function getPriority(): int
+ {
+ return 0;
+ }
+
+ public function supports(\SplFileInfo $file): bool
+ {
+ return true;
+ }
+
+ public function setWhitespacesConfig(WhitespacesFixerConfig $config): void
+ {
+ if (!$this instanceof WhitespacesAwareFixerInterface) {
+ throw new \LogicException('Cannot run method for class not implementing "PhpCsFixer\Fixer\WhitespacesAwareFixerInterface".');
+ }
+
+ $this->whitespacesConfig = $config;
+ }
+
+ abstract protected function applyFix(\SplFileInfo $file, Tokens $tokens): void;
+
+ private function getDefaultWhitespacesFixerConfig(): WhitespacesFixerConfig
+ {
+ static $defaultWhitespacesFixerConfig = null;
+
+ if (null === $defaultWhitespacesFixerConfig) {
+ $defaultWhitespacesFixerConfig = new WhitespacesFixerConfig(' ', "\n");
+ }
+
+ return $defaultWhitespacesFixerConfig;
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php
new file mode 100644
index 0000000..ed169c9
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractFopenFlagFixer.php
@@ -0,0 +1,122 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use PhpCsFixer\Tokenizer\Analyzer\ArgumentsAnalyzer;
+use PhpCsFixer\Tokenizer\Tokens;
+
+/**
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+abstract class AbstractFopenFlagFixer extends AbstractFunctionReferenceFixer
+{
+ public function isCandidate(Tokens $tokens): bool
+ {
+ return $tokens->isAllTokenKindsFound([\T_STRING, \T_CONSTANT_ENCAPSED_STRING]);
+ }
+
+ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
+ {
+ $argumentsAnalyzer = new ArgumentsAnalyzer();
+
+ $index = 0;
+ $end = $tokens->count() - 1;
+ while (true) {
+ $candidate = $this->find('fopen', $tokens, $index, $end);
+
+ if (null === $candidate) {
+ break;
+ }
+
+ $index = $candidate[1]; // proceed to '(' of `fopen`
+
+ // fetch arguments
+ $arguments = $argumentsAnalyzer->getArguments(
+ $tokens,
+ $index,
+ $candidate[2],
+ );
+
+ $argumentsCount = \count($arguments); // argument count sanity check
+
+ if ($argumentsCount < 2 || $argumentsCount > 4) {
+ continue;
+ }
+
+ // get second argument index
+ $argumentKeys = array_keys($arguments);
+ \assert(isset($argumentKeys[1]));
+ $argumentStartIndex = $argumentKeys[1];
+
+ \assert(isset($arguments[$argumentStartIndex]));
+ $this->fixFopenFlagToken(
+ $tokens,
+ $argumentStartIndex,
+ $arguments[$argumentStartIndex],
+ );
+ }
+ }
+
+ abstract protected function fixFopenFlagToken(Tokens $tokens, int $argumentStartIndex, int $argumentEndIndex): void;
+
+ protected function isValidModeString(string $mode): bool
+ {
+ $modeLength = \strlen($mode);
+ if ($modeLength < 1 || $modeLength > 13) { // 13 === length 'r+w+a+x+c+etb'
+ return false;
+ }
+
+ $validFlags = [
+ 'a' => true,
+ 'b' => true,
+ 'c' => true,
+ 'e' => true,
+ 'r' => true,
+ 't' => true,
+ 'w' => true,
+ 'x' => true,
+ ];
+
+ if (!isset($validFlags[$mode[0]])) {
+ return false;
+ }
+
+ unset($validFlags[$mode[0]]);
+
+ for ($i = 1; $i < $modeLength; ++$i) {
+ if (isset($validFlags[$mode[$i]])) {
+ unset($validFlags[$mode[$i]]);
+
+ continue;
+ }
+
+ if ('+' !== $mode[$i]
+ || (
+ 'a' !== $mode[$i - 1] // 'a+','c+','r+','w+','x+'
+ && 'c' !== $mode[$i - 1]
+ && 'r' !== $mode[$i - 1]
+ && 'w' !== $mode[$i - 1]
+ && 'x' !== $mode[$i - 1]
+ )
+ ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php
new file mode 100644
index 0000000..2e53056
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractFunctionReferenceFixer.php
@@ -0,0 +1,74 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use PhpCsFixer\Tokenizer\Analyzer\FunctionsAnalyzer;
+use PhpCsFixer\Tokenizer\Tokens;
+
+/**
+ * @internal
+ *
+ * @author Vladimir Reznichenko
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+abstract class AbstractFunctionReferenceFixer extends AbstractFixer
+{
+ private ?FunctionsAnalyzer $functionsAnalyzer = null;
+
+ public function isCandidate(Tokens $tokens): bool
+ {
+ return $tokens->isTokenKindFound(\T_STRING);
+ }
+
+ public function isRisky(): bool
+ {
+ return true;
+ }
+
+ /**
+ * Looks up Tokens sequence for suitable candidates and delivers boundaries information,
+ * which can be supplied by other methods in this abstract class.
+ *
+ * @return ?array{int, int, int} returns $functionName, $openParenthesis, $closeParenthesis packed into array
+ */
+ protected function find(string $functionNameToSearch, Tokens $tokens, int $start = 0, ?int $end = null): ?array
+ {
+ if (null === $this->functionsAnalyzer) {
+ $this->functionsAnalyzer = new FunctionsAnalyzer();
+ }
+
+ // make interface consistent with findSequence
+ $end ??= $tokens->count();
+
+ // find raw sequence which we can analyse for context
+ $candidateSequence = [[\T_STRING, $functionNameToSearch], '('];
+ $matches = $tokens->findSequence($candidateSequence, $start, $end, false);
+
+ if (null === $matches) {
+ return null; // not found, simply return without further attempts
+ }
+
+ // translate results for humans
+ \assert(isset(array_keys($matches)[1]));
+ [$functionName, $openParenthesis] = array_keys($matches);
+
+ if (!$this->functionsAnalyzer->isGlobalFunctionCall($tokens, $functionName)) {
+ return $this->find($functionNameToSearch, $tokens, $openParenthesis, $end);
+ }
+
+ return [$functionName, $openParenthesis, $tokens->findBlockEnd(Tokens::BLOCK_TYPE_PARENTHESIS, $openParenthesis)];
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php
new file mode 100644
index 0000000..8ac22a4
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractNoUselessElseFixer.php
@@ -0,0 +1,207 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use PhpCsFixer\Tokenizer\Tokens;
+
+/**
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+abstract class AbstractNoUselessElseFixer extends AbstractFixer
+{
+ public function getPriority(): int
+ {
+ // should be run before NoWhitespaceInBlankLineFixer, NoExtraBlankLinesFixer, BracesFixer and after NoEmptyStatementFixer.
+ return 39;
+ }
+
+ protected function isSuperfluousElse(Tokens $tokens, int $index): bool
+ {
+ $previousBlockStart = $index;
+
+ do {
+ // Check if all 'if', 'else if ' and 'elseif' blocks above this 'else' always end,
+ // if so this 'else' is overcomplete.
+ [$previousBlockStart, $previousBlockEnd] = $this->getPreviousBlock($tokens, $previousBlockStart);
+
+ // short 'if' detection
+ $previous = $previousBlockEnd;
+ if ($tokens[$previous]->equals('}')) {
+ $previous = $tokens->getPrevMeaningfulToken($previous);
+ }
+
+ if (
+ !$tokens[$previous]->equals(';') // 'if' block doesn't end with semicolon, keep 'else'
+ || $tokens[$tokens->getPrevMeaningfulToken($previous)]->equals('{') // empty 'if' block, keep 'else'
+ ) {
+ return false;
+ }
+
+ $candidateIndex = $tokens->getPrevTokenOfKind(
+ $previous,
+ [
+ ';',
+ [\T_BREAK],
+ [\T_CLOSE_TAG],
+ [\T_CONTINUE],
+ [\T_EXIT],
+ [\T_GOTO],
+ [\T_IF],
+ [\T_RETURN],
+ [\T_THROW],
+ ],
+ );
+
+ if (null === $candidateIndex || $tokens[$candidateIndex]->equalsAny([';', [\T_CLOSE_TAG], [\T_IF]])) {
+ return false;
+ }
+
+ if ($tokens[$candidateIndex]->isGivenKind(\T_THROW)) {
+ $previousIndex = $tokens->getPrevMeaningfulToken($candidateIndex);
+
+ if (!$tokens[$previousIndex]->equalsAny([';', '{'])) {
+ return false;
+ }
+ }
+
+ if ($this->isInConditional($tokens, $candidateIndex, $previousBlockStart)
+ || $this->isInConditionWithoutBraces($tokens, $candidateIndex, $previousBlockStart)
+ ) {
+ return false;
+ }
+
+ // implicit continue, i.e. delete candidate
+ } while (!$tokens[$previousBlockStart]->isGivenKind(\T_IF));
+
+ return true;
+ }
+
+ /**
+ * Return the first and last token index of the previous block.
+ *
+ * [0] First is either T_IF, T_ELSE or T_ELSEIF
+ * [1] Last is either '}' or ';' / T_CLOSE_TAG for short notation blocks
+ *
+ * @param int $index T_IF, T_ELSE, T_ELSEIF
+ *
+ * @return array{int, int}
+ */
+ private function getPreviousBlock(Tokens $tokens, int $index): array
+ {
+ $close = $previous = $tokens->getPrevMeaningfulToken($index);
+ // short 'if' detection
+ if ($tokens[$close]->equals('}')) {
+ $previous = $tokens->findBlockStart(Tokens::BLOCK_TYPE_BRACE, $close);
+ }
+
+ $open = $tokens->getPrevTokenOfKind($previous, [[\T_IF], [\T_ELSE], [\T_ELSEIF]]);
+ if ($tokens[$open]->isGivenKind(\T_IF)) {
+ $elseCandidate = $tokens->getPrevMeaningfulToken($open);
+ if ($tokens[$elseCandidate]->isGivenKind(\T_ELSE)) {
+ $open = $elseCandidate;
+ }
+ }
+
+ return [$open, $close];
+ }
+
+ /**
+ * @param int $index Index of the token to check
+ * @param int $lowerLimitIndex Lower limit index. Since the token to check will always be in a conditional we must stop checking at this index
+ */
+ private function isInConditional(Tokens $tokens, int $index, int $lowerLimitIndex): bool
+ {
+ $candidateIndex = $tokens->getPrevTokenOfKind($index, [')', ';', ':']);
+ if ($tokens[$candidateIndex]->equals(':')) {
+ return true;
+ }
+
+ if (!$tokens[$candidateIndex]->equals(')')) {
+ return false; // token is ';' or close tag
+ }
+
+ // token is always ')' here.
+ // If it is part of the condition the token is always in, return false.
+ // If it is not it is a nested condition so return true
+ $open = $tokens->findBlockStart(Tokens::BLOCK_TYPE_PARENTHESIS, $candidateIndex);
+
+ return $tokens->getPrevMeaningfulToken($open) > $lowerLimitIndex;
+ }
+
+ /**
+ * For internal use only, as it is not perfect.
+ *
+ * Returns if the token at given index is part of an if/elseif/else statement
+ * without {}. Assumes not passing the last `;`/close tag of the statement, not
+ * out of range index, etc.
+ *
+ * @param int $index Index of the token to check
+ */
+ private function isInConditionWithoutBraces(Tokens $tokens, int $index, int $lowerLimitIndex): bool
+ {
+ do {
+ if ($tokens[$index]->isComment() || $tokens[$index]->isWhitespace()) {
+ $index = $tokens->getPrevMeaningfulToken($index);
+ }
+
+ $token = $tokens[$index];
+ if ($token->isGivenKind([\T_IF, \T_ELSEIF, \T_ELSE])) {
+ return true;
+ }
+
+ if ($token->equals(';')) {
+ return false;
+ }
+
+ if ($token->equals('{')) {
+ $index = $tokens->getPrevMeaningfulToken($index);
+
+ // OK if belongs to: for, do, while, foreach
+ // Not OK if belongs to: if, else, elseif
+ if ($tokens[$index]->isGivenKind(\T_DO)) {
+ --$index;
+
+ continue;
+ }
+
+ if (!$tokens[$index]->equals(')')) {
+ return false; // like `else {`
+ }
+
+ $index = $tokens->findBlockStart(
+ Tokens::BLOCK_TYPE_PARENTHESIS,
+ $index,
+ );
+
+ $index = $tokens->getPrevMeaningfulToken($index);
+ if ($tokens[$index]->isGivenKind([\T_IF, \T_ELSEIF])) {
+ return false;
+ }
+ } elseif ($token->equals(')')) {
+ $type = Tokens::detectBlockType($token);
+ $index = $tokens->findBlockStart(
+ $type['type'],
+ $index,
+ );
+
+ $index = $tokens->getPrevMeaningfulToken($index);
+ } else {
+ --$index;
+ }
+ } while ($index > $lowerLimitIndex);
+
+ return false;
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php
new file mode 100644
index 0000000..ee620ed
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocToTypeDeclarationFixer.php
@@ -0,0 +1,348 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use PhpCsFixer\DocBlock\Annotation;
+use PhpCsFixer\DocBlock\DocBlock;
+use PhpCsFixer\DocBlock\TypeExpression;
+use PhpCsFixer\Fixer\ConfigurableFixerInterface;
+use PhpCsFixer\Fixer\ConfigurableFixerTrait;
+use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
+use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
+use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
+use PhpCsFixer\Tokenizer\Analyzer\NamespacesAnalyzer;
+use PhpCsFixer\Tokenizer\Analyzer\NamespaceUsesAnalyzer;
+use PhpCsFixer\Tokenizer\CT;
+use PhpCsFixer\Tokenizer\Token;
+use PhpCsFixer\Tokenizer\Tokens;
+
+/**
+ * @internal
+ *
+ * @phpstan-type _CommonTypeInfo array{commonType: string, isNullable: bool}
+ * @phpstan-type _AutogeneratedInputConfiguration array{
+ * scalar_types?: bool,
+ * types_map?: array,
+ * union_types?: bool,
+ * }
+ * @phpstan-type _AutogeneratedComputedConfiguration array{
+ * scalar_types: bool,
+ * types_map: array,
+ * union_types: bool,
+ * }
+ *
+ * @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+abstract class AbstractPhpdocToTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface
+{
+ /** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
+ use ConfigurableFixerTrait;
+
+ private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER
+ .'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)';
+
+ /**
+ * @var array
+ */
+ private array $versionSpecificTypes = [
+ 'void' => 7_01_00,
+ 'iterable' => 7_01_00,
+ 'object' => 7_02_00,
+ 'mixed' => 8_00_00,
+ 'never' => 8_01_00,
+ ];
+
+ /**
+ * @var array
+ */
+ private array $scalarTypes = [
+ 'bool' => true,
+ 'float' => true,
+ 'int' => true,
+ 'string' => true,
+ ];
+
+ /**
+ * @var array
+ */
+ private static array $syntaxValidationCache = [];
+
+ public function isRisky(): bool
+ {
+ return true;
+ }
+
+ abstract protected function isSkippedType(string $type): bool;
+
+ protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
+ {
+ return new FixerConfigurationResolver([
+ (new FixerOptionBuilder('scalar_types', 'Fix also scalar types; may have unexpected behaviour due to PHP bad type coercion system.'))
+ ->setAllowedTypes(['bool'])
+ ->setDefault(true)
+ ->getOption(),
+ (new FixerOptionBuilder('union_types', 'Fix also union types; turned on by default on PHP >= 8.0.0.'))
+ ->setAllowedTypes(['bool'])
+ ->setDefault(\PHP_VERSION_ID >= 8_00_00)
+ ->getOption(),
+ (new FixerOptionBuilder('types_map', 'Map of custom types, e.g. template types from PHPStan.'))
+ ->setAllowedTypes(['array'])
+ ->setDefault([])
+ ->getOption(),
+ ]);
+ }
+
+ /**
+ * @param int $index The index of the function token
+ */
+ protected function findFunctionDocComment(Tokens $tokens, int $index): ?int
+ {
+ do {
+ $index = $tokens->getPrevNonWhitespace($index);
+ } while ($tokens[$index]->isGivenKind([
+ \T_COMMENT,
+ \T_ABSTRACT,
+ \T_FINAL,
+ \T_PRIVATE,
+ \T_PROTECTED,
+ \T_PUBLIC,
+ \T_STATIC,
+ ]));
+
+ if ($tokens[$index]->isGivenKind(\T_DOC_COMMENT)) {
+ return $index;
+ }
+
+ return null;
+ }
+
+ /**
+ * @return list
+ */
+ protected function getAnnotationsFromDocComment(string $name, Tokens $tokens, int $docCommentIndex): array
+ {
+ $namespacesAnalyzer = new NamespacesAnalyzer();
+ $namespace = $namespacesAnalyzer->getNamespaceAt($tokens, $docCommentIndex);
+
+ $namespaceUsesAnalyzer = new NamespaceUsesAnalyzer();
+ $namespaceUses = $namespaceUsesAnalyzer->getDeclarationsInNamespace($tokens, $namespace);
+
+ $doc = new DocBlock(
+ $tokens[$docCommentIndex]->getContent(),
+ $namespace,
+ $namespaceUses,
+ );
+
+ return $doc->getAnnotationsOfType($name);
+ }
+
+ /**
+ * @return list
+ */
+ protected function createTypeDeclarationTokens(string $type, bool $isNullable): array
+ {
+ $newTokens = [];
+
+ if (true === $isNullable && 'mixed' !== $type) {
+ $newTokens[] = new Token([CT::T_NULLABLE_TYPE, '?']);
+ }
+
+ $newTokens = array_merge(
+ $newTokens,
+ $this->createTokensFromRawType($type)->toArray(),
+ );
+
+ // 'scalar's, 'void', 'iterable' and 'object' must be unqualified
+ foreach ($newTokens as $i => $token) {
+ if ($token->isGivenKind(\T_STRING)) {
+ $typeUnqualified = $token->getContent();
+
+ if (
+ (isset($this->scalarTypes[$typeUnqualified]) || isset($this->versionSpecificTypes[$typeUnqualified]))
+ && isset($newTokens[$i - 1])
+ && '\\' === $newTokens[$i - 1]->getContent()
+ ) {
+ unset($newTokens[$i - 1]);
+ }
+ }
+ }
+
+ return array_values($newTokens);
+ }
+
+ /**
+ * Each fixer inheriting from this class must define a way of creating token collection representing type
+ * gathered from phpDoc, e.g. `Foo|Bar` should be transformed into 3 tokens (`Foo`, `|` and `Bar`).
+ * This can't be standardised, because some types may be allowed in one place, and invalid in others.
+ *
+ * @param string $type Type determined (and simplified) from phpDoc
+ */
+ abstract protected function createTokensFromRawType(string $type): Tokens;
+
+ /**
+ * @return ?_CommonTypeInfo
+ */
+ protected function getCommonTypeInfo(TypeExpression $typesExpression, bool $isReturnType): ?array
+ {
+ $commonType = $typesExpression->getCommonType();
+ $isNullable = $typesExpression->allowsNull();
+
+ if (null === $commonType) {
+ return null;
+ }
+
+ if ($isNullable && 'void' === $commonType) {
+ return null;
+ }
+
+ if ('static' === $commonType && (!$isReturnType || \PHP_VERSION_ID < 8_00_00)) {
+ $commonType = 'self';
+ }
+
+ if ($this->isSkippedType($commonType)) {
+ return null;
+ }
+
+ if (\array_key_exists($commonType, $this->configuration['types_map'])) {
+ $commonType = $this->configuration['types_map'][$commonType];
+ }
+
+ if (isset($this->versionSpecificTypes[$commonType]) && \PHP_VERSION_ID < $this->versionSpecificTypes[$commonType]) {
+ return null;
+ }
+
+ if (isset($this->scalarTypes[$commonType])) {
+ if (false === $this->configuration['scalar_types']) {
+ return null;
+ }
+ } elseif (!Preg::match('/^'.self::REGEX_CLASS.'$/', $commonType)) {
+ return null;
+ }
+
+ return ['commonType' => $commonType, 'isNullable' => $isNullable];
+ }
+
+ protected function getUnionTypes(TypeExpression $typesExpression, bool $isReturnType): ?string
+ {
+ if (\PHP_VERSION_ID < 8_00_00) {
+ return null;
+ }
+
+ if (!$typesExpression->isUnionType()) {
+ return null;
+ }
+
+ if (false === $this->configuration['union_types']) {
+ return null;
+ }
+
+ $types = $typesExpression->getTypes();
+ $isNullable = $typesExpression->allowsNull();
+ $unionTypes = [];
+ $containsOtherThanIterableType = false;
+ $containsOtherThanEmptyType = false;
+
+ foreach ($types as $type) {
+ if ('null' === $type) {
+ continue;
+ }
+
+ if ($this->isSkippedType($type)) {
+ return null;
+ }
+
+ if (isset($this->versionSpecificTypes[$type]) && \PHP_VERSION_ID < $this->versionSpecificTypes[$type]) {
+ return null;
+ }
+
+ $typeExpression = new TypeExpression($type, null, []);
+ $commonTypeInfo = $this->getCommonTypeInfo($typeExpression, $isReturnType);
+
+ if (null === $commonTypeInfo) {
+ return null;
+ }
+
+ $commonType = $commonTypeInfo['commonType'];
+
+ if (!$containsOtherThanIterableType && !\in_array($commonType, ['array', \Traversable::class, 'iterable'], true)) {
+ $containsOtherThanIterableType = true;
+ }
+ if ($isReturnType && !$containsOtherThanEmptyType && !\in_array($commonType, ['null', 'void', 'never'], true)) {
+ $containsOtherThanEmptyType = true;
+ }
+
+ if (!$isNullable && $commonTypeInfo['isNullable']) {
+ $isNullable = true;
+ }
+
+ $unionTypes[] = $commonType;
+ }
+
+ if (!$containsOtherThanIterableType) {
+ return null;
+ }
+ if ($isReturnType && !$containsOtherThanEmptyType) {
+ return null;
+ }
+
+ if ($isNullable) {
+ $unionTypes[] = 'null';
+ }
+
+ return implode($typesExpression->getTypesGlue(), array_unique($unionTypes));
+ }
+
+ final protected function isValidSyntax(string $code): bool
+ {
+ if (!isset(self::$syntaxValidationCache[$code])) {
+ try {
+ Tokens::fromCode($code);
+ self::$syntaxValidationCache[$code] = true;
+ } catch (\ParseError $e) {
+ self::$syntaxValidationCache[$code] = false;
+ }
+ }
+
+ return self::$syntaxValidationCache[$code];
+ }
+
+ /**
+ * @return list
+ */
+ final protected static function getTypesToExclude(string $content): array
+ {
+ $typesToExclude = [];
+
+ $docBlock = new DocBlock($content);
+
+ foreach ($docBlock->getAnnotationsOfType(['phpstan-type', 'psalm-type']) as $annotation) {
+ $typesToExclude[] = $annotation->getTypeExpression()->toString();
+ }
+
+ foreach ($docBlock->getAnnotationsOfType(['phpstan-import-type', 'psalm-import-type']) as $annotation) {
+ $content = trim($annotation->getContent());
+ if (Preg::match('/\bas\s+('.TypeExpression::REGEX_IDENTIFIER.')$/', $content, $matches)) {
+ $typesToExclude[] = $matches[1];
+
+ continue;
+ }
+ $typesToExclude[] = $annotation->getTypeExpression()->toString();
+ }
+
+ return $typesToExclude;
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php
new file mode 100644
index 0000000..c8cdebe
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractPhpdocTypesFixer.php
@@ -0,0 +1,93 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use PhpCsFixer\DocBlock\Annotation;
+use PhpCsFixer\DocBlock\DocBlock;
+use PhpCsFixer\DocBlock\TypeExpression;
+use PhpCsFixer\Tokenizer\Token;
+use PhpCsFixer\Tokenizer\Tokens;
+
+/**
+ * This abstract fixer provides a base for fixers to fix types in PHPDoc.
+ *
+ * @author Graham Campbell
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+abstract class AbstractPhpdocTypesFixer extends AbstractFixer
+{
+ public function isCandidate(Tokens $tokens): bool
+ {
+ return $tokens->isTokenKindFound(\T_DOC_COMMENT);
+ }
+
+ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
+ {
+ foreach ($tokens as $index => $token) {
+ if (!$token->isGivenKind(\T_DOC_COMMENT)) {
+ continue;
+ }
+
+ $doc = new DocBlock($token->getContent());
+ $annotations = $doc->getAnnotationsOfType(Annotation::TAGS_WITH_TYPES);
+
+ if (0 === \count($annotations)) {
+ continue;
+ }
+
+ foreach ($annotations as $annotation) {
+ $this->fixType($annotation);
+ }
+
+ $tokens[$index] = new Token([\T_DOC_COMMENT, $doc->getContent()]);
+ }
+ }
+
+ /**
+ * Actually normalize the given type.
+ */
+ abstract protected function normalize(string $type): string;
+
+ /**
+ * Fix the type at the given line.
+ *
+ * We must be super careful not to modify parts of words.
+ *
+ * This will be nicely handled behind the scenes for us by the annotation class.
+ */
+ private function fixType(Annotation $annotation): void
+ {
+ $typeExpression = $annotation->getTypeExpression();
+
+ if (null === $typeExpression) {
+ return;
+ }
+
+ $newTypeExpression = $typeExpression->mapTypes(function (TypeExpression $type) {
+ if (!$type->isCompositeType()) {
+ $value = $this->normalize($type->toString());
+
+ return new TypeExpression($value, null, []);
+ }
+
+ return $type;
+ });
+
+ $annotation->setTypes([$newTypeExpression->toString()]);
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php
new file mode 100644
index 0000000..3bd1d19
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/AbstractProxyFixer.php
@@ -0,0 +1,110 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use PhpCsFixer\Fixer\FixerInterface;
+use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
+use PhpCsFixer\Tokenizer\Tokens;
+
+/**
+ * @author Dariusz Rumiński
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+abstract class AbstractProxyFixer extends AbstractFixer
+{
+ /**
+ * @var non-empty-array
+ */
+ protected array $proxyFixers;
+
+ public function __construct()
+ {
+ $proxyFixers = [];
+ foreach (Utils::sortFixers($this->createProxyFixers()) as $proxyFixer) {
+ $proxyFixers[$proxyFixer->getName()] = $proxyFixer;
+ }
+ $this->proxyFixers = $proxyFixers;
+
+ parent::__construct();
+ }
+
+ public function isCandidate(Tokens $tokens): bool
+ {
+ foreach ($this->proxyFixers as $fixer) {
+ if ($fixer->isCandidate($tokens)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public function isRisky(): bool
+ {
+ foreach ($this->proxyFixers as $fixer) {
+ if ($fixer->isRisky()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public function getPriority(): int
+ {
+ if (\count($this->proxyFixers) > 1) {
+ throw new \LogicException('You need to override this method to provide the priority of combined fixers.');
+ }
+
+ return reset($this->proxyFixers)->getPriority();
+ }
+
+ public function supports(\SplFileInfo $file): bool
+ {
+ foreach ($this->proxyFixers as $fixer) {
+ if ($fixer->supports($file)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public function setWhitespacesConfig(WhitespacesFixerConfig $config): void
+ {
+ parent::setWhitespacesConfig($config);
+
+ foreach ($this->proxyFixers as $fixer) {
+ if ($fixer instanceof WhitespacesAwareFixerInterface) {
+ $fixer->setWhitespacesConfig($config);
+ }
+ }
+ }
+
+ protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
+ {
+ foreach ($this->proxyFixers as $fixer) {
+ $fixer->fix($file, $tokens);
+ }
+ }
+
+ /**
+ * @return non-empty-list
+ */
+ abstract protected function createProxyFixers(): array;
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php
new file mode 100644
index 0000000..b713784
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/Cache.php
@@ -0,0 +1,154 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+use PhpCsFixer\Config\NullRuleCustomisationPolicy;
+use PhpCsFixer\Utils;
+
+/**
+ * @author Andreas Möller
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+final class Cache implements CacheInterface
+{
+ private SignatureInterface $signature;
+
+ /**
+ * @var array
+ */
+ private array $hashes = [];
+
+ public function __construct(SignatureInterface $signature)
+ {
+ $this->signature = $signature;
+ }
+
+ public function getSignature(): SignatureInterface
+ {
+ return $this->signature;
+ }
+
+ public function has(string $file): bool
+ {
+ return \array_key_exists($file, $this->hashes);
+ }
+
+ public function get(string $file): ?string
+ {
+ return $this->hashes[$file] ?? null;
+ }
+
+ public function set(string $file, string $hash): void
+ {
+ $this->hashes[$file] = $hash;
+ }
+
+ public function clear(string $file): void
+ {
+ unset($this->hashes[$file]);
+ }
+
+ public function toJson(): string
+ {
+ try {
+ return json_encode(
+ [
+ 'php' => $this->getSignature()->getPhpVersion(),
+ 'version' => $this->getSignature()->getFixerVersion(),
+ 'indent' => $this->getSignature()->getIndent(),
+ 'lineEnding' => $this->getSignature()->getLineEnding(),
+ 'rules' => $this->getSignature()->getRules(),
+ 'ruleCustomisationPolicyVersion' => $this->getSignature()->getRuleCustomisationPolicyVersion(),
+ 'hashes' => $this->hashes,
+ ],
+ \JSON_THROW_ON_ERROR,
+ );
+ } catch (\JsonException $e) {
+ throw new \UnexpectedValueException(\sprintf(
+ 'Cannot encode cache signature to JSON, error: "%s". If you have non-UTF8 chars in your signature, like in license for `header_comment`, consider enabling `ext-mbstring` or install `symfony/polyfill-mbstring`.',
+ $e->getMessage(),
+ ));
+ }
+ }
+
+ /**
+ * @throws \InvalidArgumentException
+ */
+ public static function fromJson(string $json): self
+ {
+ try {
+ $data = json_decode($json, true, 512, \JSON_THROW_ON_ERROR);
+ } catch (\JsonException $e) {
+ throw new \InvalidArgumentException(\sprintf(
+ 'Value needs to be a valid JSON string, got "%s", error: "%s".',
+ $json,
+ $e->getMessage(),
+ ));
+ }
+
+ $requiredKeys = [
+ 'php',
+ 'version',
+ 'indent',
+ 'lineEnding',
+ 'rules',
+ // 'ruleCustomisationPolicyVersion', // @TODO v4: require me
+ 'hashes',
+ ];
+
+ $missingKeys = array_diff_key(array_flip($requiredKeys), $data);
+
+ if (\count($missingKeys) > 0) {
+ throw new \InvalidArgumentException(\sprintf(
+ 'JSON data is missing keys %s',
+ Utils::naturalLanguageJoin(array_keys($missingKeys)),
+ ));
+ }
+
+ $signature = new Signature(
+ $data['php'],
+ $data['version'],
+ $data['indent'],
+ $data['lineEnding'],
+ $data['rules'],
+ $data['ruleCustomisationPolicyVersion'] ?? NullRuleCustomisationPolicy::VERSION_FOR_CACHE,
+ );
+
+ $cache = new self($signature);
+
+ // before v3.11.1 the hashes were crc32 encoded and saved as integers
+ // @TODO v4: remove the to string cast/array_map
+ $cache->hashes = array_map(static fn ($v): string => \is_int($v) ? (string) $v : $v, $data['hashes']);
+
+ return $cache;
+ }
+
+ /**
+ * @internal
+ */
+ public function backfillHashes(self $oldCache): bool
+ {
+ if (!$this->getSignature()->equals($oldCache->getSignature())) {
+ return false;
+ }
+
+ $this->hashes = array_merge($oldCache->hashes, $this->hashes);
+
+ return true;
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php
new file mode 100644
index 0000000..2a6cca9
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheInterface.php
@@ -0,0 +1,37 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+/**
+ * @author Andreas Möller
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+interface CacheInterface
+{
+ public function getSignature(): SignatureInterface;
+
+ public function has(string $file): bool;
+
+ public function get(string $file): ?string;
+
+ public function set(string $file, string $hash): void;
+
+ public function clear(string $file): void;
+
+ public function toJson(): string;
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php
new file mode 100644
index 0000000..3115344
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/CacheManagerInterface.php
@@ -0,0 +1,31 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+/**
+ * @author Dariusz Rumiński
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+interface CacheManagerInterface
+{
+ public function needFixing(string $file, string $fileContent): bool;
+
+ public function setFile(string $file, string $fileContent): void;
+
+ public function setFileHash(string $file, string $hash): void;
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php
new file mode 100644
index 0000000..e7bc196
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/Directory.php
@@ -0,0 +1,53 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+/**
+ * @author Dariusz Rumiński
+ *
+ * @readonly
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+final class Directory implements DirectoryInterface
+{
+ private string $directoryName;
+
+ public function __construct(string $directoryName)
+ {
+ $this->directoryName = $directoryName;
+ }
+
+ public function getRelativePathTo(string $file): string
+ {
+ $file = $this->normalizePath($file);
+
+ if (
+ '' === $this->directoryName
+ || !str_starts_with(strtolower($file), strtolower($this->directoryName.\DIRECTORY_SEPARATOR))
+ ) {
+ return $file;
+ }
+
+ return substr($file, \strlen($this->directoryName) + 1);
+ }
+
+ private function normalizePath(string $path): string
+ {
+ return str_replace(['\\', '/'], \DIRECTORY_SEPARATOR, $path);
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/DirectoryInterface.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/DirectoryInterface.php
new file mode 100644
index 0000000..9b5bb26
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/DirectoryInterface.php
@@ -0,0 +1,25 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+/**
+ * @author Dariusz Rumiński
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+interface DirectoryInterface
+{
+ public function getRelativePathTo(string $file): string;
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php
new file mode 100644
index 0000000..5c539f0
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/FileCacheManager.php
@@ -0,0 +1,147 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+use PhpCsFixer\Hasher;
+
+/**
+ * Class supports caching information about state of fixing files.
+ *
+ * Cache is supported only for phar version and version installed via composer.
+ *
+ * File will be processed by PHP CS Fixer only if any of the following conditions is fulfilled:
+ * - cache is corrupt
+ * - fixer version changed
+ * - rules changed
+ * - file is new
+ * - file changed
+ *
+ * @author Dariusz Rumiński
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+final class FileCacheManager implements CacheManagerInterface
+{
+ public const WRITE_FREQUENCY = 10;
+
+ private FileHandlerInterface $handler;
+
+ private SignatureInterface $signature;
+
+ private bool $isDryRun;
+
+ private DirectoryInterface $cacheDirectory;
+
+ private int $writeCounter = 0;
+
+ private bool $signatureWasUpdated = false;
+
+ private CacheInterface $cache;
+
+ public function __construct(
+ FileHandlerInterface $handler,
+ SignatureInterface $signature,
+ bool $isDryRun = false,
+ ?DirectoryInterface $cacheDirectory = null
+ ) {
+ $this->handler = $handler;
+ $this->signature = $signature;
+ $this->isDryRun = $isDryRun;
+ $this->cacheDirectory = $cacheDirectory ?? new Directory('');
+
+ $this->readCache();
+ }
+
+ public function __destruct()
+ {
+ if (true === $this->signatureWasUpdated || 0 !== $this->writeCounter) {
+ $this->writeCache();
+ }
+ }
+
+ /**
+ * This class is not intended to be serialized,
+ * and cannot be deserialized (see __wakeup method).
+ */
+ public function __serialize(): array
+ {
+ throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
+ }
+
+ /**
+ * Disable the deserialization of the class to prevent attacker executing
+ * code by leveraging the __destruct method.
+ *
+ * @param array $data
+ *
+ * @see https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection
+ */
+ public function __unserialize(array $data): void
+ {
+ throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
+ }
+
+ public function needFixing(string $file, string $fileContent): bool
+ {
+ $file = $this->cacheDirectory->getRelativePathTo($file);
+
+ return !$this->cache->has($file) || $this->cache->get($file) !== $this->calcHash($fileContent);
+ }
+
+ public function setFile(string $file, string $fileContent): void
+ {
+ $this->setFileHash($file, $this->calcHash($fileContent));
+ }
+
+ public function setFileHash(string $file, string $hash): void
+ {
+ $file = $this->cacheDirectory->getRelativePathTo($file);
+
+ if ($this->isDryRun && $this->cache->has($file) && $this->cache->get($file) !== $hash) {
+ $this->cache->clear($file);
+ } else {
+ $this->cache->set($file, $hash);
+ }
+
+ if (self::WRITE_FREQUENCY === ++$this->writeCounter) {
+ $this->writeCounter = 0;
+ $this->writeCache();
+ }
+ }
+
+ private function readCache(): void
+ {
+ $cache = $this->handler->read();
+
+ if (null === $cache || !$this->signature->equals($cache->getSignature())) {
+ $cache = new Cache($this->signature);
+ $this->signatureWasUpdated = true;
+ }
+
+ $this->cache = $cache;
+ }
+
+ private function writeCache(): void
+ {
+ $this->handler->write($this->cache);
+ }
+
+ private function calcHash(string $content): string
+ {
+ return Hasher::calculate($content);
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php
new file mode 100644
index 0000000..252ed8c
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandler.php
@@ -0,0 +1,186 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+use Symfony\Component\Filesystem\Exception\IOException;
+
+/**
+ * @author Andreas Möller
+ * @author Dariusz Rumiński
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+final class FileHandler implements FileHandlerInterface
+{
+ private \SplFileInfo $fileInfo;
+
+ private int $fileMTime = 0;
+
+ public function __construct(string $file)
+ {
+ $this->fileInfo = new \SplFileInfo($file);
+ }
+
+ public function getFile(): string
+ {
+ return $this->fileInfo->getPathname();
+ }
+
+ public function read(): ?CacheInterface
+ {
+ if (!$this->fileInfo->isFile() || !$this->fileInfo->isReadable()) {
+ return null;
+ }
+
+ $fileObject = $this->fileInfo->openFile('r');
+
+ $cache = $this->readFromHandle($fileObject);
+ $this->fileMTime = $this->getFileCurrentMTime();
+
+ unset($fileObject); // explicitly close file handler
+
+ return $cache;
+ }
+
+ public function write(CacheInterface $cache): void
+ {
+ $this->ensureFileIsWriteable();
+
+ $fileObject = $this->fileInfo->openFile('r+');
+
+ if (method_exists($cache, 'backfillHashes') && $this->fileMTime < $this->getFileCurrentMTime()) {
+ $resultOfFlock = $fileObject->flock(\LOCK_EX);
+ if (false === $resultOfFlock) {
+ // Lock failed, OK - we continue without the lock.
+ // noop
+ }
+
+ $oldCache = $this->readFromHandle($fileObject);
+
+ $fileObject->rewind();
+
+ if (null !== $oldCache) {
+ $cache->backfillHashes($oldCache);
+ }
+ }
+
+ $resultOfTruncate = $fileObject->ftruncate(0);
+ if (false === $resultOfTruncate) {
+ // Truncate failed. OK - we do not save the cache.
+ return;
+ }
+
+ $resultOfWrite = $fileObject->fwrite($cache->toJson());
+ if (false === $resultOfWrite) {
+ // Write failed. OK - we did not save the cache.
+ return;
+ }
+
+ $resultOfFlush = $fileObject->fflush();
+ if (false === $resultOfFlush) {
+ // Flush failed. OK - part of cache can be missing, in case this was last chunk in this pid.
+ // noop
+ }
+
+ $this->fileMTime = time(); // we could take the fresh `mtime` of file that we just modified with `$this->getFileCurrentMTime()`, but `time()` should be good enough here and reduce IO operation
+ }
+
+ private function getFileCurrentMTime(): int
+ {
+ clearstatcache(true, $this->fileInfo->getPathname());
+
+ $mtime = $this->fileInfo->getMTime();
+
+ if (false === $mtime) {
+ // cannot check mtime? OK - let's pretend file is old.
+ $mtime = 0;
+ }
+
+ return $mtime;
+ }
+
+ private function readFromHandle(\SplFileObject $fileObject): ?CacheInterface
+ {
+ try {
+ $size = $fileObject->getSize();
+ if (false === $size || 0 === $size) {
+ return null;
+ }
+
+ $content = $fileObject->fread($size);
+
+ if (false === $content) {
+ return null;
+ }
+
+ return Cache::fromJson($content);
+ } catch (\InvalidArgumentException $exception) {
+ return null;
+ }
+ }
+
+ private function ensureFileIsWriteable(): void
+ {
+ if ($this->fileInfo->isFile() && $this->fileInfo->isWritable()) {
+ // all good
+ return;
+ }
+
+ if ($this->fileInfo->isDir()) {
+ throw new IOException(
+ \sprintf('Cannot write cache file "%s" as the location exists as directory.', $this->fileInfo->getRealPath()),
+ 0,
+ null,
+ $this->fileInfo->getPathname(),
+ );
+ }
+
+ if ($this->fileInfo->isFile() && !$this->fileInfo->isWritable()) {
+ throw new IOException(
+ \sprintf('Cannot write to file "%s" as it is not writable.', $this->fileInfo->getRealPath()),
+ 0,
+ null,
+ $this->fileInfo->getPathname(),
+ );
+ }
+
+ $this->createFile($this->fileInfo->getPathname());
+ }
+
+ private function createFile(string $file): void
+ {
+ $dir = \dirname($file);
+
+ // Ensure path is created, but ignore if already exists. FYI: ignore EA suggestion in IDE,
+ // `mkdir()` returns `false` for existing paths, so we can't mix it with `is_dir()` in one condition.
+ if (!@is_dir($dir)) {
+ @mkdir($dir, 0777, true);
+ }
+
+ if (!@is_dir($dir)) {
+ throw new IOException(
+ \sprintf('Directory of cache file "%s" does not exists and couldn\'t be created.', $file),
+ 0,
+ null,
+ $file,
+ );
+ }
+
+ @touch($file);
+ @chmod($file, 0666);
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandlerInterface.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandlerInterface.php
new file mode 100644
index 0000000..7f8b430
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/FileHandlerInterface.php
@@ -0,0 +1,31 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+/**
+ * @author Andreas Möller
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+interface FileHandlerInterface
+{
+ public function getFile(): string;
+
+ public function read(): ?CacheInterface;
+
+ public function write(CacheInterface $cache): void;
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php
new file mode 100644
index 0000000..808c0f0
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/NullCacheManager.php
@@ -0,0 +1,35 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+/**
+ * @author Andreas Möller
+ * @author Dariusz Rumiński
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+final class NullCacheManager implements CacheManagerInterface
+{
+ public function needFixing(string $file, string $fileContent): bool
+ {
+ return true;
+ }
+
+ public function setFile(string $file, string $fileContent): void {}
+
+ public function setFileHash(string $file, string $hash): void {}
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php
new file mode 100644
index 0000000..a33efa1
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/Signature.php
@@ -0,0 +1,124 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+use PhpCsFixer\Future;
+
+/**
+ * @author Andreas Möller
+ *
+ * @readonly
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+final class Signature implements SignatureInterface
+{
+ private string $phpVersion;
+
+ private string $fixerVersion;
+
+ private string $indent;
+
+ private string $lineEnding;
+
+ /**
+ * @var array|bool>
+ */
+ private array $rules;
+
+ private string $ruleCustomisationPolicyVersion;
+
+ /**
+ * @param array|bool> $rules
+ */
+ public function __construct(string $phpVersion, string $fixerVersion, string $indent, string $lineEnding, array $rules, string $ruleCustomisationPolicyVersion)
+ {
+ $this->phpVersion = $phpVersion;
+ $this->fixerVersion = $fixerVersion;
+ $this->indent = $indent;
+ $this->lineEnding = $lineEnding;
+ $this->rules = self::makeJsonEncodable($rules);
+ $this->ruleCustomisationPolicyVersion = $ruleCustomisationPolicyVersion;
+ }
+
+ public function getPhpVersion(): string
+ {
+ return $this->phpVersion;
+ }
+
+ public function getFixerVersion(): string
+ {
+ return $this->fixerVersion;
+ }
+
+ public function getIndent(): string
+ {
+ return $this->indent;
+ }
+
+ public function getLineEnding(): string
+ {
+ return $this->lineEnding;
+ }
+
+ public function getRules(): array
+ {
+ return $this->rules;
+ }
+
+ public function getRuleCustomisationPolicyVersion(): string
+ {
+ return $this->ruleCustomisationPolicyVersion;
+ }
+
+ public function equals(SignatureInterface $signature): bool
+ {
+ return $this->phpVersion === $signature->getPhpVersion()
+ && $this->fixerVersion === $signature->getFixerVersion()
+ && $this->indent === $signature->getIndent()
+ && $this->lineEnding === $signature->getLineEnding()
+ && $this->rules === $signature->getRules()
+ && $this->ruleCustomisationPolicyVersion === $signature->getRuleCustomisationPolicyVersion();
+ }
+
+ /**
+ * @param array|bool> $data
+ *
+ * @return array|bool>
+ */
+ private static function makeJsonEncodable(array $data): array
+ {
+ array_walk_recursive($data, static function (&$item, $key): void {
+ if (\is_string($item) && false === mb_detect_encoding($item, 'utf-8', true)) {
+ $item = base64_encode($item);
+ } elseif (\is_object($item)) {
+ if ($item instanceof \JsonSerializable) {
+ $item = \get_class($item).'#'.json_encode($item, \JSON_THROW_ON_ERROR);
+ } else {
+ Future::triggerDeprecation(new \InvalidArgumentException(\sprintf(
+ 'Can not serialize cache signature, unhandled object under "%s" key: "%s" - implement "%s".',
+ $key,
+ \get_class($item),
+ \JsonSerializable::class,
+ )));
+ }
+ }
+ });
+
+ return $data;
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php
new file mode 100644
index 0000000..19659c6
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Cache/SignatureInterface.php
@@ -0,0 +1,42 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Cache;
+
+/**
+ * @author Andreas Möller
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+interface SignatureInterface
+{
+ public function getPhpVersion(): string;
+
+ public function getFixerVersion(): string;
+
+ public function getIndent(): string;
+
+ public function getLineEnding(): string;
+
+ /**
+ * @return array|bool>
+ */
+ public function getRules(): array;
+
+ public function getRuleCustomisationPolicyVersion(): string;
+
+ public function equals(self $signature): bool;
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/ComposerJsonReader.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/ComposerJsonReader.php
new file mode 100644
index 0000000..ed57020
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/ComposerJsonReader.php
@@ -0,0 +1,178 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use Composer\Semver\Semver;
+use Symfony\Component\Filesystem\Exception\IOException;
+
+/**
+ * @author Dariusz Rumiński
+ *
+ * @internal
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+final class ComposerJsonReader
+{
+ private const COMPOSER_FILENAME = 'composer.json';
+
+ private bool $isProcessed = false;
+
+ private ?string $php = null;
+
+ private ?string $phpUnit = null;
+
+ private static ?self $singleton = null;
+
+ public static function createSingleton(): self
+ {
+ if (null === self::$singleton) {
+ self::$singleton = new self();
+ }
+
+ return self::$singleton;
+ }
+
+ public function getPhp(): ?string
+ {
+ $this->processFile();
+
+ return $this->php;
+ }
+
+ public function getPhpUnit(): ?string
+ {
+ $this->processFile();
+
+ return $this->phpUnit;
+ }
+
+ private function processFile(): void
+ {
+ if (true === $this->isProcessed) {
+ return;
+ }
+
+ if (!file_exists(self::COMPOSER_FILENAME)) {
+ throw new IOException(\sprintf('Failed to read file "%s".', self::COMPOSER_FILENAME));
+ }
+
+ $readResult = file_get_contents(self::COMPOSER_FILENAME);
+ if (false === $readResult) {
+ throw new IOException(\sprintf('Failed to read file "%s".', self::COMPOSER_FILENAME));
+ }
+
+ $this->processJson($readResult);
+ }
+
+ private function processJson(string $json): void
+ {
+ if (true === $this->isProcessed) {
+ return;
+ }
+
+ $composerJson = json_decode($json, true, 512, \JSON_THROW_ON_ERROR);
+
+ $this->php = self::getMinSemVer(self::detectPhp($composerJson));
+ $this->phpUnit = self::getMinSemVer(self::detectPackage($composerJson, 'phpunit/phpunit'));
+
+ $this->isProcessed = true;
+ }
+
+ private static function getMinSemVer(?string $version): ?string
+ {
+ if ('' === $version || null === $version) {
+ return null;
+ }
+
+ /** @var non-empty-list $arr */
+ $arr = Preg::split('/\s*\|\|?\s*/', trim($version));
+
+ $arr = array_map(static function ($v) {
+ $v = ltrim($v, 'v^~>= ');
+
+ $v = substr($v, 0, strcspn($v, ' ,-'));
+
+ if (str_ends_with($v, '.*')) {
+ $v = substr($v, 0, -\strlen('.*'));
+ }
+
+ return $v;
+ }, $arr);
+
+ $textVersion = array_find($arr, static fn ($v) => true === Preg::match('/^\D/', $v));
+
+ if (null !== $textVersion) {
+ return null;
+ }
+
+ /** @var non-empty-list $sortedArr */
+ $sortedArr = Semver::sort($arr);
+
+ $min = $sortedArr[0];
+ $parts = explode('.', $min);
+
+ return \sprintf('%s.%s', (int) $parts[0], (int) ($parts[1] ?? 0));
+ }
+
+ /**
+ * @param array $composerJson
+ */
+ private static function detectPhp(array $composerJson): ?string
+ {
+ $version = [];
+
+ if (isset($composerJson['config']['platform']['php'])) {
+ $version[] = $composerJson['config']['platform']['php'];
+ }
+
+ if (isset($composerJson['require-dev']['php'])) {
+ $version[] = $composerJson['require-dev']['php'];
+ }
+
+ if (isset($composerJson['require']['php'])) {
+ $version[] = $composerJson['require']['php'];
+ }
+
+ if (\count($version) > 0) {
+ return implode(' || ', $version);
+ }
+
+ return null;
+ }
+
+ /**
+ * @param array $composerJson
+ * @param non-empty-string $package
+ */
+ private static function detectPackage(array $composerJson, string $package): ?string
+ {
+ $version = [];
+
+ if (isset($composerJson['require-dev'][$package])) {
+ $version[] = $composerJson['require-dev'][$package];
+ }
+
+ if (isset($composerJson['require'][$package])) {
+ $version[] = $composerJson['require'][$package];
+ }
+
+ if (\count($version) > 0) {
+ return implode(' || ', $version);
+ }
+
+ return null;
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Config.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Config.php
new file mode 100644
index 0000000..979aef7
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Config.php
@@ -0,0 +1,321 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer;
+
+use PhpCsFixer\Config\RuleCustomisationPolicyAwareConfigInterface;
+use PhpCsFixer\Config\RuleCustomisationPolicyInterface;
+use PhpCsFixer\Fixer\FixerInterface;
+use PhpCsFixer\RuleSet\RuleSetDefinitionInterface;
+use PhpCsFixer\Runner\Parallel\ParallelConfig;
+use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
+
+/**
+ * @author Fabien Potencier
+ * @author Katsuhiro Ogawa
+ * @author Dariusz Rumiński
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ *
+ * @api-extendable
+ */
+class Config implements ConfigInterface, ParallelAwareConfigInterface, UnsupportedPhpVersionAllowedConfigInterface, CustomRulesetsAwareConfigInterface, RuleCustomisationPolicyAwareConfigInterface
+{
+ /**
+ * @var non-empty-string
+ */
+ private string $cacheFile = '.php-cs-fixer.cache';
+
+ /**
+ * @var list
+ */
+ private array $customFixers = [];
+
+ /**
+ * @var array
+ */
+ private array $customRuleSets = [];
+
+ /**
+ * @var null|iterable<\SplFileInfo>
+ */
+ private ?iterable $finder = null;
+
+ private string $format;
+
+ private bool $hideProgress = false;
+
+ /**
+ * @var non-empty-string
+ */
+ private string $indent = ' ';
+
+ private bool $isRiskyAllowed = false;
+
+ /**
+ * @var non-empty-string
+ */
+ private string $lineEnding = "\n";
+
+ private string $name;
+
+ private ParallelConfig $parallelConfig;
+
+ private ?string $phpExecutable = null;
+
+ /**
+ * @TODO: 4.0 - update to @PER
+ *
+ * @var array|bool>
+ */
+ private array $rules;
+
+ private bool $usingCache = true;
+
+ private bool $isUnsupportedPhpVersionAllowed = false;
+
+ private ?RuleCustomisationPolicyInterface $ruleCustomisationPolicy = null;
+
+ public function __construct(string $name = 'default')
+ {
+ $this->name = $name.(Future::isFutureModeEnabled() ? ' (future mode)' : '');
+ $this->rules = Future::getV4OrV3(['@PER-CS' => true], ['@PSR12' => true]); // @TODO 4.0 | 3.x switch to '@auto' for v4
+ $this->format = Future::getV4OrV3('@auto', 'txt');
+ $this->parallelConfig = ParallelConfigFactory::detect();
+
+ // @TODO 4.0 cleanup
+ if (false !== getenv('PHP_CS_FIXER_IGNORE_ENV')) {
+ $this->isUnsupportedPhpVersionAllowed = filter_var(getenv('PHP_CS_FIXER_IGNORE_ENV'), \FILTER_VALIDATE_BOOL);
+ }
+ }
+
+ /**
+ * @return non-empty-string
+ */
+ public function getCacheFile(): string
+ {
+ return $this->cacheFile;
+ }
+
+ public function getCustomFixers(): array
+ {
+ return $this->customFixers;
+ }
+
+ public function getCustomRuleSets(): array
+ {
+ return array_values($this->customRuleSets);
+ }
+
+ /**
+ * @return iterable<\SplFileInfo>
+ */
+ public function getFinder(): iterable
+ {
+ $this->finder ??= new Finder();
+
+ return $this->finder;
+ }
+
+ public function getFormat(): string
+ {
+ return $this->format;
+ }
+
+ public function getHideProgress(): bool
+ {
+ return $this->hideProgress;
+ }
+
+ public function getIndent(): string
+ {
+ return $this->indent;
+ }
+
+ public function getLineEnding(): string
+ {
+ return $this->lineEnding;
+ }
+
+ public function getName(): string
+ {
+ return $this->name;
+ }
+
+ public function getParallelConfig(): ParallelConfig
+ {
+ return $this->parallelConfig;
+ }
+
+ public function getPhpExecutable(): ?string
+ {
+ return $this->phpExecutable;
+ }
+
+ public function getRiskyAllowed(): bool
+ {
+ return $this->isRiskyAllowed;
+ }
+
+ public function getRules(): array
+ {
+ return $this->rules;
+ }
+
+ public function getUsingCache(): bool
+ {
+ return $this->usingCache;
+ }
+
+ public function getUnsupportedPhpVersionAllowed(): bool
+ {
+ return $this->isUnsupportedPhpVersionAllowed;
+ }
+
+ public function getRuleCustomisationPolicy(): ?RuleCustomisationPolicyInterface
+ {
+ return $this->ruleCustomisationPolicy;
+ }
+
+ public function registerCustomFixers(iterable $fixers): ConfigInterface
+ {
+ foreach ($fixers as $fixer) {
+ $this->addCustomFixer($fixer);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param list $ruleSets
+ */
+ public function registerCustomRuleSets(array $ruleSets): ConfigInterface
+ {
+ foreach ($ruleSets as $ruleset) {
+ $this->customRuleSets[$ruleset->getName()] = $ruleset;
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param non-empty-string $cacheFile
+ */
+ public function setCacheFile(string $cacheFile): ConfigInterface
+ {
+ $this->cacheFile = $cacheFile;
+
+ return $this;
+ }
+
+ public function setFinder(iterable $finder): ConfigInterface
+ {
+ $this->finder = $finder;
+
+ return $this;
+ }
+
+ public function setFormat(string $format): ConfigInterface
+ {
+ $this->format = $format;
+
+ return $this;
+ }
+
+ public function setHideProgress(bool $hideProgress): ConfigInterface
+ {
+ $this->hideProgress = $hideProgress;
+
+ return $this;
+ }
+
+ /**
+ * @param non-empty-string $indent
+ */
+ public function setIndent(string $indent): ConfigInterface
+ {
+ $this->indent = $indent;
+
+ return $this;
+ }
+
+ /**
+ * @param non-empty-string $lineEnding
+ */
+ public function setLineEnding(string $lineEnding): ConfigInterface
+ {
+ $this->lineEnding = $lineEnding;
+
+ return $this;
+ }
+
+ public function setParallelConfig(ParallelConfig $config): ConfigInterface
+ {
+ $this->parallelConfig = $config;
+
+ return $this;
+ }
+
+ public function setPhpExecutable(?string $phpExecutable): ConfigInterface
+ {
+ $this->phpExecutable = $phpExecutable;
+
+ return $this;
+ }
+
+ public function setRiskyAllowed(bool $isRiskyAllowed): ConfigInterface
+ {
+ $this->isRiskyAllowed = $isRiskyAllowed;
+
+ return $this;
+ }
+
+ public function setRules(array $rules): ConfigInterface
+ {
+ $this->rules = $rules;
+
+ return $this;
+ }
+
+ public function setUsingCache(bool $usingCache): ConfigInterface
+ {
+ $this->usingCache = $usingCache;
+
+ return $this;
+ }
+
+ public function setUnsupportedPhpVersionAllowed(bool $isUnsupportedPhpVersionAllowed): ConfigInterface
+ {
+ $this->isUnsupportedPhpVersionAllowed = $isUnsupportedPhpVersionAllowed;
+
+ return $this;
+ }
+
+ public function setRuleCustomisationPolicy(?RuleCustomisationPolicyInterface $ruleCustomisationPolicy): ConfigInterface
+ {
+ // explicitly prevent policy with no proper version defined
+ if (null !== $ruleCustomisationPolicy && '' === $ruleCustomisationPolicy->getPolicyVersionForCache()) {
+ throw new \InvalidArgumentException('The Rule Customisation Policy version cannot be an empty string.');
+ }
+
+ $this->ruleCustomisationPolicy = $ruleCustomisationPolicy;
+
+ return $this;
+ }
+
+ private function addCustomFixer(FixerInterface $fixer): void
+ {
+ $this->customFixers[] = $fixer;
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Config/NullRuleCustomisationPolicy.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Config/NullRuleCustomisationPolicy.php
new file mode 100644
index 0000000..e6753bb
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Config/NullRuleCustomisationPolicy.php
@@ -0,0 +1,38 @@
+
+ * Dariusz Rumiński
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace PhpCsFixer\Config;
+
+/**
+ * EXPERIMENTAL: This feature is experimental and does not fall under the backward compatibility promise.
+ *
+ * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
+ */
+final class NullRuleCustomisationPolicy implements RuleCustomisationPolicyInterface
+{
+ /**
+ * @internal
+ */
+ public const VERSION_FOR_CACHE = 'null-policy';
+
+ public function getPolicyVersionForCache(): string
+ {
+ return self::VERSION_FOR_CACHE;
+ }
+
+ public function getRuleCustomisers(): array
+ {
+ return [];
+ }
+}
diff --git a/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Config/RuleCustomisationPolicyAwareConfigInterface.php b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Config/RuleCustomisationPolicyAwareConfigInterface.php
new file mode 100644
index 0000000..5f9c511
--- /dev/null
+++ b/trilhas_poo/vendor/friendsofphp/php-cs-fixer/src/Config/RuleCustomisationPolicyAwareConfigInterface.php
@@ -0,0 +1,45 @@
+
+ * Dariusz Rumiński