⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.103
Server IP:
45.79.8.107
Server:
Linux localhost 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.2-1ubuntu2.22
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
php
/
Composer
/
DependencyResolver
/
View File Name :
RuleSetIterator.php
* Jordi Boggiano
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\DependencyResolver; /** * @author Nils Adermann
* @implements \Iterator
*/ class RuleSetIterator implements \Iterator { /** @var array
*/ protected $rules; /** @var array
*/ protected $types; /** @var int */ protected $currentOffset; /** @var RuleSet::TYPE_*|-1 */ protected $currentType; /** @var int */ protected $currentTypeOffset; /** * @param array
$rules */ public function __construct(array $rules) { $this->rules = $rules; $this->types = array_keys($rules); sort($this->types); $this->rewind(); } /** * @return Rule */ #[\ReturnTypeWillChange] public function current() { return $this->rules[$this->currentType][$this->currentOffset]; } /** * @return RuleSet::TYPE_*|-1 */ #[\ReturnTypeWillChange] public function key() { return $this->currentType; } /** * @return void */ #[\ReturnTypeWillChange] public function next() { $this->currentOffset++; if (!isset($this->rules[$this->currentType])) { return; } if ($this->currentOffset >= \count($this->rules[$this->currentType])) { $this->currentOffset = 0; do { $this->currentTypeOffset++; if (!isset($this->types[$this->currentTypeOffset])) { $this->currentType = -1; break; } $this->currentType = $this->types[$this->currentTypeOffset]; } while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType])); } } /** * @return void */ #[\ReturnTypeWillChange] public function rewind() { $this->currentOffset = 0; $this->currentTypeOffset = -1; $this->currentType = -1; do { $this->currentTypeOffset++; if (!isset($this->types[$this->currentTypeOffset])) { $this->currentType = -1; break; } $this->currentType = $this->types[$this->currentTypeOffset]; } while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType])); } /** * @return bool */ #[\ReturnTypeWillChange] public function valid() { return isset($this->rules[$this->currentType], $this->rules[$this->currentType][$this->currentOffset]); } }