repo_name
stringlengths
2
55
dataset
stringclasses
1 value
owner
stringlengths
3
31
lang
stringclasses
10 values
func_name
stringlengths
1
104
code
stringlengths
20
96.7k
docstring
stringlengths
1
4.92k
url
stringlengths
94
241
sha
stringlengths
40
40
inventory
github_2023
carmonabernaldiego
php
SqlServerConnection.getSchemaBuilder
public function getSchemaBuilder() { if (is_null($this->schemaGrammar)) { $this->useDefaultSchemaGrammar(); } return new SqlServerBuilder($this); }
/** * Get a schema builder instance for the connection. * * @return \Illuminate\Database\Schema\SqlServerBuilder */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Database/SqlServerConnection.php#L75-L82
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
StatusCommand.__construct
public function __construct(Migrator $migrator) { parent::__construct(); $this->migrator = $migrator; }
/** * Create a new migration rollback command instance. * * @param \Illuminate\Database\Migrations\Migrator $migrator * @return void */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/StatusCommand.php#L38-L43
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
HasManyThrough.findOrFail
public function findOrFail($id, $columns = ['*']) { $result = $this->find($id, $columns); if (is_array($id)) { if (count($result) == count(array_unique($id))) { return $result; } } elseif (! is_null($result)) { return $result; } throw (new ModelNotFoundException)->setModel(get_class($this->related)); }
/** * Find a related model by its primary key or throw an exception. * * @param mixed $id * @param array $columns * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection * * @throws \Illuminate\Database\Eloquent\ModelNotFoundException */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/HasManyThrough.php#L324-L337
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
MorphMany.getResults
public function getResults() { return $this->query->get(); }
/** * Get the results of the relationship. * * @return mixed */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/MorphMany.php#L14-L17
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Builder.addDynamic
protected function addDynamic($segment, $connector, $parameters, $index) { // Once we have parsed out the columns and formatted the boolean operators we // are ready to add it to this query as a where clause just like any other // clause on the query. Then we'll increment the parameter index values. $bool = strtolower($connector); $this->where(Str::snake($segment), '=', $parameters[$index], $bool); }
/** * Add a single dynamic where clause statement to the query. * * @param string $segment * @param string $connector * @param array $parameters * @param int $index * @return void */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php#L1302-L1310
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Grammar.dateBasedWhere
protected function dateBasedWhere($type, Builder $query, $where) { $value = $this->parameter($where['value']); return $type.'('.$this->wrap($where['column']).') '.$where['operator'].' '.$value; }
/** * Compile a date based where clause. * * @param string $type * @param \Illuminate\Database\Query\Builder $query * @param array $where * @return string */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php#L402-L407
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Blueprint.primary
public function primary($columns, $name = null, $algorithm = null) { return $this->indexCommand('primary', $columns, $name, $algorithm); }
/** * Specify the primary key(s) for the table. * * @param string|array $columns * @param string $name * @param string|null $algorithm * @return \Illuminate\Support\Fluent */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php#L368-L371
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
MySqlGrammar.typeBoolean
protected function typeBoolean(Fluent $column) { return 'tinyint(1)'; }
/** * Create the column definition for a boolean type. * * @param \Illuminate\Support\Fluent $column * @return string */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php#L539-L542
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
TestResponse.assertSee
public function assertSee($value) { PHPUnit::assertContains($value, $this->getContent()); return $this; }
/** * Assert that the given string is contained within the response. * * @param string $value * @return $this */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php#L251-L256
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Writer.notice
public function notice($message, array $context = []) { $this->writeLog(__FUNCTION__, $message, $context); }
/** * Log a notice to the logs. * * @param string $message * @param array $context * @return void */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Log/Writer.php#L136-L139
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Mailable.buildViewData
public function buildViewData() { $data = $this->viewData; foreach ((new ReflectionClass($this))->getProperties(ReflectionProperty::IS_PUBLIC) as $property) { if ($property->getDeclaringClass()->getName() != self::class) { $data[$property->getName()] = $property->getValue($this); } } return $data; }
/** * Build the view data for the message. * * @return array */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php#L227-L238
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Markdown.__construct
public function __construct(ViewFactory $view, array $options = []) { $this->view = $view; $this->theme = $options['theme'] ?? 'default'; $this->loadComponentsFrom($options['paths'] ?? []); }
/** * Create a new Markdown renderer instance. * * @param \Illuminate\Contracts\View\Factory $view * @param array $options * @return void */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php#L40-L45
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Message.prepAttachment
protected function prepAttachment($attachment, $options = []) { // First we will check for a MIME type on the message, which instructs the // mail client on what type of attachment the file is so that it may be // downloaded correctly by the user. The MIME option is not required. if (isset($options['mime'])) { $attachment->setContentType($options['mime']); } // If an alternative name was given as an option, we will set that on this // attachment so that it will be downloaded with the desired names from // the developer, otherwise the default file names will get assigned. if (isset($options['as'])) { $attachment->setFilename($options['as']); } $this->swift->attach($attachment); return $this; }
/** * Prepare and attach the given attachment. * * @param \Swift_Attachment $attachment * @param array $options * @return $this */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Mail/Message.php#L284-L303
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
DatabaseJobRecord.__construct
public function __construct($record) { $this->record = $record; }
/** * Create a new job record instance. * * @param \stdClass $record * @return void */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJobRecord.php#L24-L27
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
MiddlewareNameResolver.resolve
public static function resolve($name, $map, $middlewareGroups) { // When the middleware is simply a Closure, we will return this Closure instance // directly so that Closures can be registered as middleware inline, which is // convenient on occasions when the developers are experimenting with them. if ($name instanceof Closure) { return $name; } if (isset($map[$name]) && $map[$name] instanceof Closure) { return $map[$name]; } // If the middleware is the name of a middleware group, we will return the array // of middlewares that belong to the group. This allows developers to group a // set of middleware under single keys that can be conveniently referenced. if (isset($middlewareGroups[$name])) { return static::parseMiddlewareGroup($name, $map, $middlewareGroups); } // Finally, when the middleware is simply a string mapped to a class name the // middleware name will get parsed into the full class name and parameters // which may be run using the Pipeline which accepts this string format. list($name, $parameters) = array_pad(explode(':', $name, 2), 2, null); return ($map[$name] ?? $name).(! is_null($parameters) ? ':'.$parameters : ''); }
/** * Resolve the middleware name to a class name(s) preserving passed parameters. * * @param string $name * @param array $map * @param array $middlewareGroups * @return \Closure|string|array */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Routing/MiddlewareNameResolver.php#L17-L43
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
RouteCompiler.getOptionalParameters
protected function getOptionalParameters() { preg_match_all('/\{(\w+?)\?\}/', $this->route->uri(), $matches); return isset($matches[1]) ? array_fill_keys($matches[1], null) : []; }
/** * Get the optional parameters for the route. * * @return array */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Routing/RouteCompiler.php#L48-L53
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
CacheBasedSessionHandler.read
public function read($sessionId) { return $this->cache->get($sessionId, ''); }
/** * {@inheritdoc} */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php#L56-L59
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Store.flashInput
public function flashInput(array $value) { $this->flash('_old_input', $value); }
/** * Flash an input array to the session. * * @param array $value * @return void */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Session/Store.php#L418-L421
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Collection.split
public function split($numberOfGroups) { if ($this->isEmpty()) { return new static; } $groupSize = ceil($this->count() / $numberOfGroups); return $this->chunk($groupSize); }
/** * Split a collection into a certain number of groups. * * @param int $numberOfGroups * @return static */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Support/Collection.php#L1333-L1342
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ViewErrorBag.getBag
public function getBag($key) { return Arr::get($this->bags, $key) ?: new MessageBag; }
/** * Get a MessageBag instance from the bags. * * @param string $key * @return \Illuminate\Contracts\Support\MessageBag */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Support/ViewErrorBag.php#L37-L40
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Crypt.getFacadeAccessor
protected static function getFacadeAccessor() { return 'encrypter'; }
/** * Get the registered name of the component. * * @return string */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Support/Facades/Crypt.php#L15-L18
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Facade.isMock
protected static function isMock() { $name = static::getFacadeAccessor(); return isset(static::$resolvedInstance[$name]) && static::$resolvedInstance[$name] instanceof MockInterface; }
/** * Determines whether a mock is set as the instance of the facade. * * @return bool */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php#L86-L92
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Ftp.rename
public function rename($path, $newpath) { return ftp_rename($this->getConnection(), $path, $newpath); }
/** * @inheritdoc */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/league/flysystem/src/Adapter/Ftp.php#L295-L298
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Local.writeStream
public function writeStream($path, $resource, Config $config) { $location = $this->applyPathPrefix($path); $this->ensureDirectory(dirname($location)); $stream = fopen($location, 'w+b'); if ( ! $stream || stream_copy_to_stream($resource, $stream) === false || ! fclose($stream)) { return false; } $type = 'file'; $result = compact('type', 'path'); if ($visibility = $config->get('visibility')) { $this->setVisibility($path, $visibility); $result['visibility'] = $visibility; } return $result; }
/** * @inheritdoc */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/league/flysystem/src/Adapter/Local.php#L153-L172
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Mockery.notAnyOf
public static function notAnyOf(...$args) { return new \Mockery\Matcher\NotAnyOf($args); }
/** * Return instance of NOTANYOF matcher. * * @param array ...$args * * @return \Mockery\Matcher\NotAnyOf */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/mockery/mockery/library/Mockery.php#L489-L492
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
StringManipulationGenerator.withDefaultPasses
public static function withDefaultPasses() { return new static([ new CallTypeHintPass(), new MagicMethodTypeHintsPass(), new ClassPass(), new TraitPass(), new ClassNamePass(), new InstanceMockPass(), new InterfacePass(), new MethodDefinitionPass(), new RemoveUnserializeForInternalSerializableClassesPass(), new RemoveBuiltinMethodsThatAreFinalPass(), new RemoveDestructorPass(), new ConstantsPass(), ]); }
/** * Creates a new StringManipulationGenerator with the default passes * * @return StringManipulationGenerator */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php#L46-L62
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ContainerTest.testHandlesMethodWithArgumentExpectationWhenCalledWithNestedArray
public function testHandlesMethodWithArgumentExpectationWhenCalledWithNestedArray() { $testArray = array(); $testArray['a_scalar'] = 2; $testArray['an_array'] = array(1, 2, 3); $mock = mock('MyTestClass'); $mock->shouldReceive('foo')->with(array('yourself' => 21)); $mock->foo($testArray); }
/** * @expectedException Mockery\Exception\NoMatchingExpectationException * @expectedExceptionMessage MyTestClass::foo(['a_scalar' => 2, 'an_array' => [...]]) */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/mockery/mockery/tests/Mockery/ContainerTest.php#L1241-L1251
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ExpectationTest.testGroupedOrderingThrowsExceptionWhenCallsDisordered
public function testGroupedOrderingThrowsExceptionWhenCallsDisordered() { $this->mock->shouldReceive('foo')->ordered('first'); $this->mock->shouldReceive('bar')->ordered('second'); $this->mock->bar(); $this->mock->foo(); Mockery::close(); }
/** * @expectedException \Mockery\Exception */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/mockery/mockery/tests/Mockery/ExpectationTest.php#L895-L902
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Logger.alert
public function alert($message, array $context = array()) { return $this->addRecord(static::ALERT, $message, $context); }
/** * Adds a log record at the ALERT level. * * This method allows for compatibility with common interfaces. * * @param string $message The log message * @param array $context The log context * @return bool Whether the record has been processed */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/monolog/monolog/src/Monolog/Logger.php#L747-L750
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
HtmlFormatter.formatBatch
public function formatBatch(array $records) { $message = ''; foreach ($records as $record) { $message .= $this->format($record); } return $message; }
/** * Formats a set of log records. * * @param array $records A set of records to format * @return mixed The formatted set of records */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php#L118-L126
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
SocketHandler.write
protected function write(array $record) { $this->connectIfNotConnected(); $data = $this->generateDataStream($record); $this->writeToSocket($data); }
/** * Connect (if necessary) and write to the socket * * @param array $record * * @throws \UnexpectedValueException * @throws \RuntimeException */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php#L56-L61
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
TestHandler.hasRecord
public function hasRecord($record, $level) { if (is_string($record)) { $record = array('message' => $record); } return $this->hasRecordThatPasses(function ($rec) use ($record) { if ($rec['message'] !== $record['message']) { return false; } if (isset($record['context']) && $rec['context'] !== $record['context']) { return false; } return true; }, $level); }
/** * @param string|array $record Either a message string or an array containing message and optionally context keys that will be checked against all records * @param int $level Logger::LEVEL constant value */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php#L91-L106
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
RegistryTest.testReplacesLogger
public function testReplacesLogger() { $log1 = new Logger('test1'); $log2 = new Logger('test2'); Registry::addLogger($log1, 'log'); Registry::addLogger($log2, 'log', true); $this->assertSame($log2, Registry::getInstance('log')); }
/** * @covers Monolog\Registry::addLogger */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/monolog/monolog/tests/Monolog/RegistryTest.php#L128-L138
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ChromePHPFormatterTest.testBatchFormatThrowException
public function testBatchFormatThrowException() { $formatter = new ChromePHPFormatter(); $records = array( array( 'level' => Logger::INFO, 'level_name' => 'INFO', 'channel' => 'meh', 'context' => array(), 'datetime' => new \DateTime("@0"), 'extra' => array(), 'message' => 'log', ), array( 'level' => Logger::WARNING, 'level_name' => 'WARNING', 'channel' => 'foo', 'context' => array(), 'datetime' => new \DateTime("@0"), 'extra' => array(), 'message' => 'log2', ), ); $this->assertEquals( array( array( 'meh', 'log', 'unknown', 'info', ), array( 'foo', 'log2', 'unknown', 'warn', ), ), $formatter->formatBatch($records) ); }
/** * @covers Monolog\Formatter\ChromePHPFormatter::formatBatch */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/monolog/monolog/tests/Monolog/Formatter/ChromePHPFormatterTest.php#L116-L157
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
CronExpressionTest.testIsDueHandlesDifferentTimezones
public function testIsDueHandlesDifferentTimezones() { $cron = CronExpression::factory('0 15 * * 3'); //Wednesday at 15:00 $date = '2014-01-01 15:00'; //Wednesday $utc = new DateTimeZone('UTC'); $amsterdam = new DateTimeZone('Europe/Amsterdam'); $tokyo = new DateTimeZone('Asia/Tokyo'); date_default_timezone_set('UTC'); $this->assertTrue($cron->isDue(new DateTime($date, $utc))); $this->assertFalse($cron->isDue(new DateTime($date, $amsterdam))); $this->assertFalse($cron->isDue(new DateTime($date, $tokyo))); date_default_timezone_set('Europe/Amsterdam'); $this->assertFalse($cron->isDue(new DateTime($date, $utc))); $this->assertTrue($cron->isDue(new DateTime($date, $amsterdam))); $this->assertFalse($cron->isDue(new DateTime($date, $tokyo))); date_default_timezone_set('Asia/Tokyo'); $this->assertFalse($cron->isDue(new DateTime($date, $utc))); $this->assertFalse($cron->isDue(new DateTime($date, $amsterdam))); $this->assertTrue($cron->isDue(new DateTime($date, $tokyo))); }
/** * @covers Cron\CronExpression::isDue */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/mtdowling/cron-expression/tests/Cron/CronExpressionTest.php#L223-L245
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
DeepCopy.getFirstMatchedTypeFilter
private function getFirstMatchedTypeFilter(array $filterRecords, $var) { $matched = $this->first( $filterRecords, function (array $record) use ($var) { /* @var TypeMatcher $matcher */ $matcher = $record['matcher']; return $matcher->matches($var); } ); return isset($matched) ? $matched['filter'] : null; }
/** * Returns first filter that matches variable, `null` if no such filter found. * * @param array $filterRecords Associative array with 2 members: 'filter' with value of type {@see TypeFilter} and * 'matcher' with value of type {@see TypeMatcher} * @param mixed $var * * @return TypeFilter|null */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php#L247-L260
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Carbon.createFromDate
public static function createFromDate($year = null, $month = null, $day = null, $tz = null) { return static::create($year, $month, $day, null, null, null, $tz); }
/** * Create a Carbon instance from just a date. The time portion is set to now. * * @param int|null $year * @param int|null $month * @param int|null $day * @param \DateTimeZone|string|null $tz * * @throws \InvalidArgumentException * * @return static */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/nesbot/carbon/src/Carbon/Carbon.php#L806-L809
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Carbon.subWeekdays
public function subWeekdays($value) { return $this->addWeekdays(-1 * $value); }
/** * Remove weekdays from the instance * * @param int $value * * @return static */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/nesbot/carbon/src/Carbon/Carbon.php#L3400-L3403
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
CarbonInterval.copy
public function copy() { $date = new static($this->spec()); $date->invert = $this->invert; return $date; }
/** * Get a copy of the instance. * * @return static */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php#L316-L322
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
CarbonPeriod.createFromIso
public static function createFromIso($iso, $options = null) { $params = static::parseIso8601($iso); $instance = static::createFromArray($params); if ($options !== null) { $instance->setOptions($options); } return $instance; }
/** * Create CarbonPeriod from ISO 8601 string. * * @param string $iso * @param int|null $options * * @return static */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php#L254-L265
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
FullyQualified.isQualified
public function isQualified() : bool { return false; }
/** * Checks whether the name is qualified. (E.g. Name\Name) * * @return bool Whether the name is qualified */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php#L21-L23
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Interface_.__construct
public function __construct($name, array $subNodes = [], array $attributes = []) { parent::__construct($attributes); $this->name = \is_string($name) ? new Node\Identifier($name) : $name; $this->extends = $subNodes['extends'] ?? []; $this->stmts = $subNodes['stmts'] ?? []; }
/** * Constructs a class node. * * @param string|Node\Identifier $name Name * @param array $subNodes Array of the following optional subnodes: * 'extends' => array(): Name of extended interfaces * 'stmts' => array(): Statements * @param array $attributes Additional attributes */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php#L21-L26
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
TryCatch.__construct
public function __construct(array $stmts, array $catches, Finally_ $finally = null, array $attributes = []) { parent::__construct($attributes); $this->stmts = $stmts; $this->catches = $catches; $this->finally = $finally; }
/** * Constructs a try catch node. * * @param Node\Stmt[] $stmts Statements * @param Catch_[] $catches Catches * @param null|Finally_ $finally Optionaly finally node * @param array $attributes Additional attributes */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php#L24-L29
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ParserFactoryTest.testCreate
public function testCreate($kind, $lexer, $expected) { $this->assertInstanceOf($expected, (new ParserFactory)->create($kind, $lexer)); }
/** @dataProvider provideTestCreate */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/nikic/php-parser/test/PhpParser/ParserFactoryTest.php#L12-L14
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
EmulativeTest.testNoReplaceKeywordsAfterObjectOperator
public function testNoReplaceKeywordsAfterObjectOperator($keyword) { $lexer = $this->getLexer(); $lexer->startLexing('<?php ->' . $keyword); $this->assertSame(Tokens::T_OBJECT_OPERATOR, $lexer->getNextToken()); $this->assertSame(Tokens::T_STRING, $lexer->getNextToken()); $this->assertSame(0, $lexer->getNextToken()); }
/** * @dataProvider provideTestReplaceKeywords */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/nikic/php-parser/test/PhpParser/Lexer/EmulativeTest.php#L31-L38
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
BundledComponentCollectionIterator.valid
public function valid() { return $this->position < count($this->bundledComponents); }
/** * @return bool */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php#L35-L37
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ManifestDocument.__construct
private function __construct(DOMDocument $dom) { $this->ensureCorrectDocumentType($dom); $this->dom = $dom; }
/** * ManifestDocument constructor. * * @param DOMDocument $dom */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phar-io/manifest/src/xml/ManifestDocument.php#L29-L33
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
DocBlockFactory.filterTagBlock
private function filterTagBlock($tags) { $tags = trim($tags); if (!$tags) { return null; } if ('@' !== $tags[0]) { // @codeCoverageIgnoreStart // Can't simulate this; this only happens if there is an error with the parsing of the DocBlock that // we didn't foresee. throw new \LogicException('A tag block started with text instead of an at-sign(@): ' . $tags); // @codeCoverageIgnoreEnd } return $tags; }
/** * @param $tags * @return string */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php#L260-L276
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Mixed_.__toString
public function __toString() { return 'mixed'; }
/** * Returns a rendered output of the Type as it would be used in a DocBlock. * * @return string */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php#L27-L30
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ReflectionClassNewInstancePatch.supports
public function supports(ClassNode $node) { return 'ReflectionClass' === $node->getParentClass(); }
/** * Supports ReflectionClass * * @param ClassNode $node * * @return bool */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php#L31-L34
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ReflectionClassNewInstancePatch.apply
public function apply(ClassNode $node) { foreach ($node->getMethod('newInstance')->getArguments() as $argument) { $argument->setDefault(null); } }
/** * Updates newInstance's first argument to make it optional * * @param ClassNode $node */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ReflectionClassNewInstancePatch.php#L41-L46
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
AbstractNode.getLinesOfCode
abstract public function getLinesOfCode();
/** * Returns the LOC/CLOC/NCLOC of this node. * * @return array */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php#L333-L333
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Directory.renderItem
protected function renderItem(Node $node, $total = false) { $data = [ 'numClasses' => $node->getNumClassesAndTraits(), 'numTestedClasses' => $node->getNumTestedClassesAndTraits(), 'numMethods' => $node->getNumFunctionsAndMethods(), 'numTestedMethods' => $node->getNumTestedFunctionsAndMethods(), 'linesExecutedPercent' => $node->getLineExecutedPercent(false), 'linesExecutedPercentAsString' => $node->getLineExecutedPercent(), 'numExecutedLines' => $node->getNumExecutedLines(), 'numExecutableLines' => $node->getNumExecutableLines(), 'testedMethodsPercent' => $node->getTestedFunctionsAndMethodsPercent(false), 'testedMethodsPercentAsString' => $node->getTestedFunctionsAndMethodsPercent(), 'testedClassesPercent' => $node->getTestedClassesAndTraitsPercent(false), 'testedClassesPercentAsString' => $node->getTestedClassesAndTraitsPercent() ]; if ($total) { $data['name'] = 'Total'; } else { if ($node instanceof DirectoryNode) { $data['name'] = \sprintf( '<a href="%s/index.html">%s</a>', $node->getName(), $node->getName() ); $data['icon'] = '<span class="glyphicon glyphicon-folder-open"></span> '; } else { $data['name'] = \sprintf( '<a href="%s.html">%s</a>', $node->getName(), $node->getName() ); $data['icon'] = '<span class="glyphicon glyphicon-file"></span> '; } } return $this->renderItemTemplate( new \Text_Template($this->templatePath . 'directory_item.html', '{{', '}}'), $data ); }
/** * @param Node $node * @param bool $total * * @return string */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php#L57-L100
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
NotExistingCoveredElementTest.testThree
public function testThree() { }
/** * @covers NotExistingClass::<public> */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/php-code-coverage/tests/_files/NotExistingCoveredElementTest.php#L23-L25
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
TestSuite.setBeStrictAboutChangesToGlobalState
public function setBeStrictAboutChangesToGlobalState($beStrictAboutChangesToGlobalState) { if (null === $this->beStrictAboutChangesToGlobalState && \is_bool($beStrictAboutChangesToGlobalState)) { $this->beStrictAboutChangesToGlobalState = $beStrictAboutChangesToGlobalState; } }
/** * @param bool $beStrictAboutChangesToGlobalState */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/phpunit/src/Framework/TestSuite.php#L952-L957
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
assertXmlFileEqualsXmlFile
function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = '') { return Assert::assertXmlFileEqualsXmlFile(...\func_get_args()); }
/** * Asserts that two XML files are equal. * * @param string $expectedFile * @param string $actualFile * @param string $message */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php#L1201-L1204
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Composite.__construct
public function __construct(Constraint $innerConstraint) { parent::__construct(); $this->innerConstraint = $innerConstraint; }
/** * @param Constraint $innerConstraint */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/phpunit/src/Framework/Constraint/Composite.php#L24-L28
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ResultPrinter.printIncompletes
protected function printIncompletes(TestResult $result) { $this->printDefects($result->notImplemented(), 'incomplete test'); }
/** * @param TestResult $result */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/phpunit/src/TextUI/ResultPrinter.php#L314-L317
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
RequirementsTest.testExtensionVersionOperatorLessThanEquals
public function testExtensionVersionOperatorLessThanEquals() { }
/** * @requires extension testExtOne <= 1.0 */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/phpunit/tests/_files/RequirementsTest.php#L311-L313
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ClonedDependencyTest.testThree
public function testThree($dependency) { $this->assertSame(self::$dependency, $dependency); }
/** * @depends !clone testOne */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/phpunit/tests/_files/ClonedDependencyTest.php#L31-L34
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
AssertTest.testAssertEqualsSucceeds
public function testAssertEqualsSucceeds($a, $b, $delta = 0.0, $canonicalize = false, $ignoreCase = false) { $this->assertEquals($a, $b, '', $delta, 10, $canonicalize, $ignoreCase); }
/** * @dataProvider equalProvider */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/phpunit/tests/unit/Framework/AssertTest.php#L805-L808
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
AssertTest.validInvalidJsonDataprovider
public static function validInvalidJsonDataprovider() { return [ 'error syntax in expected JSON' => ['{"Mascott"::}', '{"Mascott" : "Tux"}'], 'error UTF-8 in actual JSON' => ['{"Mascott" : "Tux"}', '{"Mascott" : :}'], ]; }
/** * @return array<string, string[]> */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/phpunit/tests/unit/Framework/AssertTest.php#L3172-L3178
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ConfigurationTest.assertConfigurationEquals
protected function assertConfigurationEquals(Configuration $expectedConfiguration, Configuration $actualConfiguration) { $this->assertEquals( $expectedConfiguration->getFilterConfiguration(), $actualConfiguration->getFilterConfiguration() ); $this->assertEquals( $expectedConfiguration->getGroupConfiguration(), $actualConfiguration->getGroupConfiguration() ); $this->assertEquals( $expectedConfiguration->getListenerConfiguration(), $actualConfiguration->getListenerConfiguration() ); $this->assertEquals( $expectedConfiguration->getLoggingConfiguration(), $actualConfiguration->getLoggingConfiguration() ); $this->assertEquals( $expectedConfiguration->getPHPConfiguration(), $actualConfiguration->getPHPConfiguration() ); $this->assertEquals( $expectedConfiguration->getPHPUnitConfiguration(), $actualConfiguration->getPHPUnitConfiguration() ); $this->assertEquals( $expectedConfiguration->getTestSuiteConfiguration()->tests(), $actualConfiguration->getTestSuiteConfiguration()->tests() ); }
/** * Asserts that the values in $actualConfiguration equal $expectedConfiguration. * * @param Configuration $expectedConfiguration * @param Configuration $actualConfiguration */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/phpunit/phpunit/tests/unit/Util/ConfigurationTest.php#L421-L457
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
NullLogger.log
public function log($level, $message, array $context = array()) { // noop }
/** * Logs with an arbitrary level. * * @param mixed $level * @param string $message * @param array $context * * @return void */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/psr/log/Psr/Log/NullLogger.php#L24-L27
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Configuration.getReadline
public function getReadline() { if (!isset($this->readline)) { $className = $this->getReadlineClass(); $this->readline = new $className( $this->getHistoryFile(), $this->getHistorySize(), $this->getEraseDuplicates() ); } return $this->readline; }
/** * Get the Psy Shell readline service. * * By default, this service uses (in order of preference): * * * GNU Readline * * Libedit * * A transient array-based readline emulation. * * @return Readline */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/psy/psysh/src/Configuration.php#L537-L549
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
CalledClassPass.enterNode
public function enterNode(Node $node) { if ($node instanceof Class_ || $node instanceof Trait_) { $this->inClass = true; } elseif ($node instanceof FuncCall && !$this->inClass) { // We'll give any args at all (besides null) a pass. // Technically we should be checking whether the args are objects, but this will do for now. // // @todo switch this to actually validate args when we get context-aware code cleaner passes. if (!empty($node->args) && !$this->isNull($node->args[0])) { return; } // We'll ignore name expressions as well (things like `$foo()`) if (!($node->name instanceof Name)) { return; } $name = \strtolower($node->name); if (\in_array($name, ['get_class', 'get_called_class'])) { $msg = \sprintf('%s() called without object from outside a class', $name); throw new ErrorException($msg, 0, E_USER_WARNING, null, $node->getLine()); } } }
/** * @throws ErrorException if get_class or get_called_class is called without an object from outside a class * * @param Node $node */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/psy/psysh/src/CodeCleaner/CalledClassPass.php#L43-L67
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ValidClassNamePass.ensureClassOrInterfaceExists
protected function ensureClassOrInterfaceExists($name, $stmt) { if (!$this->classExists($name) && !$this->interfaceExists($name)) { throw $this->createError(\sprintf('Class \'%s\' not found', $name), $stmt); } }
/** * Ensure that a referenced class _or interface_ exists. * * @throws FatalErrorException * * @param string $name * @param Stmt $stmt */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/psy/psysh/src/CodeCleaner/ValidClassNamePass.php#L244-L249
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Str.unvis
public static function unvis($input) { $output = \preg_replace_callback(self::UNVIS_RX, 'self::unvisReplace', $input); // other escapes & octal are handled by stripcslashes return \stripcslashes($output); }
/** * Decodes a string encoded by libsd's strvis. * * From `man 3 vis`: * * Use an ‘M’ to represent meta characters (characters with the 8th bit set), * and use a caret ‘^’ to represent control characters (see iscntrl(3)). * The following formats are used: * * \040 Represents ASCII space. * * \240 Represents Meta-space (&nbsp in HTML). * * \M-C Represents character ‘C’ with the 8th bit set. * Spans characters ‘\241’ through ‘\376’. * * \M^C Represents control character ‘C’ with the 8th bit set. * Spans characters ‘\200’ through ‘\237’, and ‘\377’ (as ‘\M^?’). * * \^C Represents the control character ‘C’. * Spans characters ‘\000’ through ‘\037’, and ‘\177’ (as ‘\^?’). * * The other formats are supported by PHP's stripcslashes, * except for the \s sequence (ASCII space). * * @param string $input The string to decode * * @return string */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/psy/psysh/src/Util/Str.php#L62-L67
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
RandomNodeProvider.getNode
public function getNode() { $node = hexdec(bin2hex(random_bytes(6))); // Set the multicast bit; see RFC 4122, section 4.5. $node = $node | 0x010000000000; return str_pad(dechex($node), 12, '0', STR_PAD_LEFT); }
/** * Returns the system node ID * * @return string System node ID as a hexadecimal string * @throws \Exception if it was not possible to gather sufficient entropy */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php#L33-L41
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
NumericComparatorTest.testAcceptsFails
public function testAcceptsFails($expected, $actual) { $this->assertFalse( $this->comparator->accepts($expected, $actual) ); }
/** * @covers ::accepts * @dataProvider acceptsFailsProvider */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/sebastian/comparator/tests/NumericComparatorTest.php#L91-L96
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Swift_CharacterStream_NgCharacterStream.setCharacterReaderFactory
public function setCharacterReaderFactory(Swift_CharacterReaderFactory $factory) { $this->charReaderFactory = $factory; }
/** * Set the CharacterReaderFactory for multi charset support. */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/swiftmailer/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php#L109-L112
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Swift_KeyCache_DiskKeyCache.clearAll
public function clearAll($nsKey) { if (array_key_exists($nsKey, $this->keys)) { foreach ($this->keys[$nsKey] as $itemKey => $null) { $this->clearKey($nsKey, $itemKey); } if (is_dir($this->path.'/'.$nsKey)) { rmdir($this->path.'/'.$nsKey); } unset($this->keys[$nsKey]); } }
/** * Clear all data in the namespace $nsKey if it exists. * * @param string $nsKey */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/swiftmailer/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php#L225-L236
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Swift_Mime_SimpleHeaderSet.addParameterizedHeader
public function addParameterizedHeader($name, $value = null, $params = []) { $this->storeHeader($name, $this->factory->createParameterizedHeader($name, $value, $params)); }
/** * Add a new ParameterizedHeader with $name, $value and $params. * * @param string $name * @param string $value * @param array $params */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php#L102-L105
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Swift_Plugins_LoggerPlugin.beforeTransportStopped
public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt) { $transportName = get_class($evt->getSource()); $this->logger->add(sprintf('++ Stopping %s', $transportName)); }
/** * Invoked just before a Transport is stopped. */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php#L96-L100
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Swift_Signers_SMimeSigner.__construct
public function __construct($signCertificate = null, $signPrivateKey = null, $encryptCertificate = null) { if (null !== $signPrivateKey) { $this->setSignCertificate($signCertificate, $signPrivateKey); } if (null !== $encryptCertificate) { $this->setEncryptCertificate($encryptCertificate); } $this->replacementFactory = Swift_DependencyContainer::getInstance() ->lookup('transport.replacementfactory'); $this->signOptions = PKCS7_DETACHED; $this->encryptCipher = OPENSSL_CIPHER_AES_128_CBC; }
/** * Constructor. * * @param string|null $signCertificate * @param string|null $signPrivateKey * @param string|null $encryptCertificate */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php#L49-L64
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Swift_Transport_EsmtpTransport.doMailFromCommand
protected function doMailFromCommand($address) { $address = $this->addressEncoder->encodeString($address); $handlers = $this->getActiveHandlers(); $params = []; foreach ($handlers as $handler) { $params = array_merge($params, (array) $handler->getMailParams()); } $paramStr = !empty($params) ? ' '.implode(' ', $params) : ''; $this->executeCommand( sprintf("MAIL FROM:<%s>%s\r\n", $address, $paramStr), [250], $failures, true ); }
/** Overridden to add Extension support */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php#L376-L388
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Swift_Transport_LoadBalancedTransport.getLastUsedTransport
public function getLastUsedTransport() { return $this->lastUsedTransport; }
/** * Get the Transport used in the last successful send operation. * * @return Swift_Transport */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/LoadBalancedTransport.php#L70-L73
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Swift_Transport_Esmtp_EightBitMimeHandler.getHandledKeyword
public function getHandledKeyword() { return '8BITMIME'; }
/** * Get the name of the ESMTP extension this handles. * * @return string */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/EightBitMimeHandler.php#L41-L44
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Output.getFormatter
public function getFormatter() { return $this->formatter; }
/** * {@inheritdoc} */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/console/Output/Output.php#L58-L61
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
OutputStyle.isDecorated
public function isDecorated() { return $this->output->isDecorated(); }
/** * {@inheritdoc} */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/console/Style/OutputStyle.php#L94-L97
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
SymfonyStyle.askQuestion
public function askQuestion(Question $question) { if ($this->input->isInteractive()) { $this->autoPrependBlock(); } if (!$this->questionHelper) { $this->questionHelper = new SymfonyQuestionHelper(); } $answer = $this->questionHelper->ask($this->input, $this, $question); if ($this->input->isInteractive()) { $this->newLine(); $this->bufferedOutput->write("\n"); } return $answer; }
/** * @return mixed */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/console/Style/SymfonyStyle.php#L284-L302
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
CombinedSelectorNode.getSpecificity
public function getSpecificity() { return $this->selector->getSpecificity()->plus($this->subSelector->getSpecificity()); }
/** * {@inheritdoc} */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/css-selector/Node/CombinedSelectorNode.php#L69-L72
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
HashNode.getSelector
public function getSelector() { return $this->selector; }
/** * @return NodeInterface */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/css-selector/Node/HashNode.php#L42-L45
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
CssSelectorConverterTest.testParseExceptions
public function testParseExceptions() { $converter = new CssSelectorConverter(); $converter->toXPath('h1:'); }
/** * @expectedException \Symfony\Component\CssSelector\Exception\ParseException * @expectedExceptionMessage Expected identifier, but <eof at 3> found. */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php#L42-L46
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Translator.getExtension
public function getExtension($name) { if (!isset($this->extensions[$name])) { throw new ExpressionErrorException(sprintf('Extension "%s" not registered.', $name)); } return $this->extensions[$name]; }
/** * @param string $name * * @return Extension\ExtensionInterface * * @throws ExpressionErrorException */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/css-selector/XPath/Translator.php#L147-L154
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ContainerAwareEventDispatcher.addSubscriberService
public function addSubscriberService($serviceId, $class) { @trigger_error(sprintf('The %s class is deprecated since Symfony 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.', __CLASS__), E_USER_DEPRECATED); foreach ($class::getSubscribedEvents() as $eventName => $params) { if (\is_string($params)) { $this->listenerIds[$eventName][] = array($serviceId, $params, 0); } elseif (\is_string($params[0])) { $this->listenerIds[$eventName][] = array($serviceId, $params[0], isset($params[1]) ? $params[1] : 0); } else { foreach ($params as $listener) { $this->listenerIds[$eventName][] = array($serviceId, $listener[0], isset($listener[1]) ? $listener[1] : 0); } } } }
/** * Adds a service as event subscriber. * * @param string $serviceId The service ID of the subscriber service * @param string $class The service's class name (which must implement EventSubscriberInterface) */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php#L147-L162
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
HeaderBag.__toString
public function __toString() { if (!$headers = $this->all()) { return ''; } ksort($headers); $max = max(array_map('strlen', array_keys($headers))) + 1; $content = ''; foreach ($headers as $name => $values) { $name = implode('-', array_map('ucfirst', explode('-', $name))); foreach ($values as $value) { $content .= sprintf("%-{$max}s %s\r\n", $name.':', $value); } } return $content; }
/** * Returns the headers as a string. * * @return string The headers */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/http-foundation/HeaderBag.php#L39-L56
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
HeaderBag.getIterator
public function getIterator() { return new \ArrayIterator($this->headers); }
/** * Returns an iterator for headers. * * @return \ArrayIterator An \ArrayIterator instance */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/http-foundation/HeaderBag.php#L280-L283
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Session.set
public function set($name, $value) { $this->getAttributeBag()->set($name, $value); }
/** * {@inheritdoc} */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/http-foundation/Session/Session.php#L79-L82
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
FlashBag.all
public function all() { $return = $this->peekAll(); $this->flashes = array(); return $return; }
/** * {@inheritdoc} */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/http-foundation/Session/Flash/FlashBag.php#L97-L103
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
SessionHandlerProxy.updateTimestamp
public function updateTimestamp($sessionId, $data) { return $this->handler instanceof \SessionUpdateTimestampHandlerInterface ? $this->handler->updateTimestamp($sessionId, $data) : $this->write($sessionId, $data); }
/** * {@inheritdoc} */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php#L97-L100
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Kernel.getCharset
public function getCharset() { return 'UTF-8'; }
/** * {@inheritdoc} */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/http-kernel/Kernel.php#L450-L453
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ResettableServicePass.process
public function process(ContainerBuilder $container) { if (!$container->has('services_resetter')) { return; } $services = $methods = array(); foreach ($container->findTaggedServiceIds($this->tagName, true) as $id => $tags) { $services[$id] = new Reference($id, ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE); $attributes = $tags[0]; if (!isset($attributes['method'])) { throw new RuntimeException(sprintf('Tag %s requires the "method" attribute to be set.', $this->tagName)); } $methods[$id] = $attributes['method']; } if (empty($services)) { $container->removeAlias('services_resetter'); $container->removeDefinition('services_resetter'); return; } $container->findDefinition('services_resetter') ->setArgument(0, new IteratorArgument($services)) ->setArgument(1, $methods); }
/** * {@inheritdoc} */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/http-kernel/DependencyInjection/ResettableServicePass.php#L36-L65
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
KernelTest.testLocateResourceReturnsAllMatchesBis
public function testLocateResourceReturnsAllMatchesBis() { $kernel = $this->getKernel(array('getBundle')); $kernel ->expects($this->once()) ->method('getBundle') ->will($this->returnValue(array( $this->getBundle(__DIR__.'/Fixtures/Bundle1Bundle'), $this->getBundle(__DIR__.'/Foobar'), ))) ; $this->assertEquals( array(__DIR__.'/Fixtures/Bundle1Bundle/foo.txt'), $kernel->locateResource('@Bundle1Bundle/foo.txt', null, false) ); }
/** * @group legacy */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/http-kernel/Tests/KernelTest.php#L485-L501
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
ProcessTest.testNegativeTimeoutFromSetter
public function testNegativeTimeoutFromSetter() { $p = $this->getProcess(''); $p->setTimeout(-1); }
/** * @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/process/Tests/ProcessTest.php#L93-L97
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
CompiledRoute.getRegex
public function getRegex() { return $this->regex; }
/** * Returns the regex. * * @return string The regex */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/routing/CompiledRoute.php#L105-L108
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Route.getCondition
public function getCondition() { return $this->condition; }
/** * Returns the condition. * * @return string The condition */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/routing/Route.php#L495-L498
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
HtmlDumper.setStyles
public function setStyles(array $styles) { $this->headerIsDumped = false; $this->styles = $styles + $this->styles; }
/** * {@inheritdoc} */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/var-dumper/Dumper/HtmlDumper.php#L69-L73
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
DateCasterTest.testCastDateTime
public function testCastDateTime($time, $timezone, $xDate, $xTimestamp, $xInfos) { if ((\defined('HHVM_VERSION_ID') || \PHP_VERSION_ID <= 50509) && preg_match('/[-+]\d{2}:\d{2}/', $timezone)) { $this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.'); } $stub = new Stub(); $date = new \DateTime($time, new \DateTimeZone($timezone)); $cast = DateCaster::castDateTime($date, array('foo' => 'bar'), $stub, false, 0); $xDump = <<<EODUMP array:1 [ "\\x00~\\x00date" => $xDate ] EODUMP; $this->assertDumpEquals($xDump, $cast); $xDump = <<<EODUMP Symfony\Component\VarDumper\Caster\ConstStub { +type: 1 +class: "$xDate" +value: "%A$xInfos%A" +cut: 0 +handle: 0 +refCount: 0 +position: 0 +attr: [] } EODUMP; $this->assertDumpMatchesFormat($xDump, $cast["\0~\0date"]); }
/** * @dataProvider provideDateTimes */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/symfony/var-dumper/Tests/Caster/DateCasterTest.php#L50-L82
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
php
Token.getLine
public function getLine(): int { return $this->line; }
/** * @return int */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/vendor/theseer/tokenizer/src/Token.php#L37-L39
f0fa12c3e312cab38147ff9c204945667f46da75