芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/testcors.sdektun.com/libraries/vendor/typo3/phar-stream-wrapper/src/Behavior.php
assertCommands($commands); $commands = $commands ?: $this->availableCommands; $target = clone $this; foreach ($commands as $command) { $target->assertions[$command] = $assertable; } return $target; } /** * @param string $path * @param string $command * @return bool */ public function assert(string $path, string $command): bool { $this->assertCommand($command); $this->assertAssertionCompleteness(); return $this->assertions[$command]->assert($path, $command); } /** * @param array $commands */ private function assertCommands(array $commands) { $unknownCommands = array_diff($commands, $this->availableCommands); if (empty($unknownCommands)) { return; } throw new \LogicException( sprintf( 'Unknown commands: %s', implode(', ', $unknownCommands) ), 1535189881 ); } private function assertCommand(string $command) { if (in_array($command, $this->availableCommands, true)) { return; } throw new \LogicException( sprintf( 'Unknown command "%s"', $command ), 1535189882 ); } private function assertAssertionCompleteness() { $undefinedAssertions = array_diff( $this->availableCommands, array_keys($this->assertions) ); if (empty($undefinedAssertions)) { return; } throw new \LogicException( sprintf( 'Missing assertions for commands: %s', implode(', ', $undefinedAssertions) ), 1535189883 ); } }