Skip to content

Commit

Permalink
Use FQCN for sprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Aug 3, 2024
1 parent 1bc56a4 commit 139130a
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,25 @@ This project exists thanks to all the people who contribute.
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

<!-- <open-collective-sponsors> -->
<a title="Real Money Pokies" href="https://onlinecasinoskiwi.co.nz/real-money-pokies/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Real Money Pokies" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7cee8fec-8c4d-44ac-8419-1d6b8d5a736e/NZ_logo%20(6)%20(2).jpg" width="96" height="96"></a>
<a title="Best non Gamstop sites in the UK" href="https://nongamstopcasinos.net/gb/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Best non Gamstop sites in the UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/34e340b8-e1de-4932-8a76-1b3ce2ec7ee8/logo_white%20bg%20(8).png" width="96" height="96"></a>
<a title="Real Money Pokies" href="https://onlinecasinoskiwi.co.nz/real-money-pokies/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Real Money Pokies" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7cee8fec-8c4d-44ac-8419-1d6b8d5a736e/NZ_logo%20(6)%20(2).jpg" width="96" height="96"></a>
<a title="Онлайн казино 777 Україна" href="https://777.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7e572d50-1ce8-4d69-ae12-86cc80371373/ok-ua-777.png" width="96" height="96"></a>
<a title="Non GamStop Bookies UK" href="https://nongamstopbookiesuk.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Non GamStop Bookies UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/43c5561c-8907-4ef7-a4ee-c6da054788b8/logo-site%20(3).jpg" width="96" height="96"></a>
<a title="Сasinorevisor.com" href="https://casinorevisor.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Сasinorevisor.com" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/a69e1789-9f2f-4b24-8b85-c1d4fcecde2f/200x200_white_bg%201.png" width="96" height="96"></a>
<a title="#1 Guide To Online Gambling In Canada" href="https://casinohex.org/canada/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="CasinoHex Canada" src="https://opencollective-production.s3.us-west-1.amazonaws.com/79fdbcc0-a997-11eb-abbc-25e48b63c6dc.jpg" width="127.5" height="96"></a>
<a title="Сasinorevisor.com" href="https://casinorevisor.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Сasinorevisor.com" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/a69e1789-9f2f-4b24-8b85-c1d4fcecde2f/200x200_white_bg%201.png" width="96" height="96"></a>
<a title="Znajdź najlepsze zakłady bukmacherskie w Polsce w 2023 roku. Probukmacher.pl to Twoje kompendium wiedzy na temat bukmacherów!" href="https://www.probukmacher.pl?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Probukmacher" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/caf50271-4560-4ffe-a434-ea15239168db/Screenshot_1.png" width="133.5" height="96"></a>
<a title="Casino-portugal.pt" href="https://casino-portugal.pt/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Casino-portugal.pt" src="https://logo.clearbit.com/casino-portugal.pt" width="96" height="96"></a>
<a title="Non GamStop Bookies UK" href="https://nongamstopbookiesuk.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Non GamStop Bookies UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/43c5561c-8907-4ef7-a4ee-c6da054788b8/logo-site%20(3).jpg" width="64" height="64"></a>
<a title="Porównanie kasyn online w Polsce. Darmowe automaty online." href="https://onlinekasyno-polis.pl/" target="_blank"><img alt="Online Kasyno Polis" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/12fe53d4-b2e4-4601-b9ea-7b652c414a38/274px%20274px-2.png" width="64" height="64"></a>
<a title="inkedin" href="https://inkedin.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="inkedin" src="https://logo.clearbit.com/inkedin.com" width="64" height="64"></a>
<a title="Актуальний та повносправний рейтинг онлайн казино України, ґрунтований на відгуках реальних гравців." href="https://uk.onlinecasino.in.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино України" src="https://opencollective-production.s3.us-west-1.amazonaws.com/c0b4b090-eef8-11ec-9cb7-0527a205b226.png" width="64" height="64"></a>
<a title="OnlineCasinosSpelen" href="https://onlinecasinosspelen.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="OnlineCasinosSpelen" src="https://logo.clearbit.com/onlinecasinosspelen.com" width="64" height="64"></a>
<a title="Актуальний топ-рейтинг українських онлайн казино на гривні! Щоденне оновлення топу та унікальна система ранжування, основана на відгуках гравців!" href="https://onlinecasino.in.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн Казино Украины" src="https://opencollective-production.s3.us-west-1.amazonaws.com/8fdd8aa0-e273-11ec-a95e-d38fd331cabf.png" width="64" height="64"></a>
<a title="TopRating.casino ➢ Путеводитель по онлайн-казино в Украине" href="https://toprating.casino/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Top Rating casino" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/fec14fc4-85b1-4fdc-971e-e8aabfc60926/toprating%20logo.jpg" width="64" height="64"></a>
<a title="Entertainment" href="https://www.nongamstopbets.com/casinos-not-on-gamstop/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Non-GamStop Bets UK" src="https://logo.clearbit.com/nongamstopbets.com" width="64" height="64"></a>
<a title="Slots City® ➢ Лучшее лицензионно казино онлайн и оффлайн на гривны в Украине. 【 Более1500 игровых автоматов и слотов】✅ Официально и Безопасно" href="https://slotscity.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Slots City" src="https://opencollective-production.s3.us-west-1.amazonaws.com/d7e298c0-7abe-11ed-8553-230872f5e54d.png" width="90" height="64"></a>
<a title="Gives a fun for our users" href="https://slotoking.ua/games/all-slots/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Ігрові автомати" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/94601d07-3205-4c60-9c2d-9b8194dbefb7/skg-blue.png" width="42" height="42"></a>
<a title="Get professional support for Carbon" href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&amp;utm_medium=referral&amp;utm_campaign=docs" target="_blank"><img alt="Tidelift" src="https://carbon.nesbot.com/tidelift-brand.png" width="84" height="42"></a>
<a title="Parimatch" href="https://parimattchbr.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Parimatch" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/d3d74dd5-49a3-4306-b99e-7445b78a4243/parimatch_-_hero_-_white.png" width="75" height="42"></a>
<a title="TopRating.casino ➢ Путеводитель по онлайн-казино в Украине" href="https://toprating.casino/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Top Rating casino" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/fec14fc4-85b1-4fdc-971e-e8aabfc60926/toprating%20logo.jpg" width="42" height="42"></a>
<a title="Fortune Tiger" href="https://fortune-tiger-br.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Fortune Tiger" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/88904f4a-f997-49e8-8fd4-5068acc85a98/fortune-tiger-slot-281-img-2.webp" width="42" height="42"></a><!-- </open-collective-sponsors> -->

[[See all](https://carbon.nesbot.com/#sponsors)]
Expand Down
2 changes: 1 addition & 1 deletion src/Carbon/AbstractTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function resetMessages(?string $locale = null): bool
}

foreach ($this->getDirectories() as $directory) {
$data = @include sprintf('%s/%s.php', rtrim($directory, '\\/'), $locale);
$data = @include \sprintf('%s/%s.php', rtrim($directory, '\\/'), $locale);

if ($data !== false) {
$this->messages[$locale] = $data;
Expand Down
4 changes: 2 additions & 2 deletions src/Carbon/CarbonInterval.php
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ public static function fromString(string $intervalDefinition): static

default:
throw new InvalidIntervalException(
sprintf('Invalid part %s in definition %s', $part, $intervalDefinition),
\sprintf('Invalid part %s in definition %s', $part, $intervalDefinition),
);
}
}
Expand Down Expand Up @@ -2473,7 +2473,7 @@ public static function getDateIntervalSpec(DateInterval $interval, bool $microse

$seconds = abs($interval->s);
if ($microseconds && $interval->f > 0) {
$seconds = sprintf('%d.%06d', $seconds, abs($interval->f) * 1000000);
$seconds = \sprintf('%d.%06d', $seconds, abs($interval->f) * 1000000);
}

$time = array_filter([
Expand Down
2 changes: 1 addition & 1 deletion src/Carbon/Exceptions/BadFluentConstructorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct($method, $code = 0, ?Throwable $previous = null)
{
$this->method = $method;

parent::__construct(sprintf("Unknown fluent constructor '%s'.", $method), $code, $previous);
parent::__construct(\sprintf("Unknown fluent constructor '%s'.", $method), $code, $previous);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Carbon/Exceptions/BadFluentSetterException.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct($setter, $code = 0, ?Throwable $previous = null)
{
$this->setter = $setter;

parent::__construct(sprintf("Unknown fluent setter '%s'", $setter), $code, $previous);
parent::__construct(\sprintf("Unknown fluent setter '%s'", $setter), $code, $previous);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Carbon/Exceptions/NotACarbonClassException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct($className, $code = 0, ?Throwable $previous = null)
{
$this->className = $className;

parent::__construct(sprintf(
parent::__construct(\sprintf(
'Given class does not implement %s: %s',
CarbonInterface::class,
$className,
Expand Down
2 changes: 1 addition & 1 deletion src/Carbon/Traits/Creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minut
}

$second = ($second < 10 ? '0' : '').number_format($second, 6);
$instance = static::rawCreateFromFormat('!Y-n-j G:i:s.u', sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $timezone);
$instance = static::rawCreateFromFormat('!Y-n-j G:i:s.u', \sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $timezone);

if ($instance && $fixYear !== null) {
$instance = $instance->addYears($fixYear);
Expand Down
4 changes: 2 additions & 2 deletions src/Carbon/Traits/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ public function __set($name, $value)
public function set(Unit|array|string $name, DateTimeZone|Month|string|int|float|null $value = null): static
{
if ($this->isImmutable()) {
throw new ImmutableException(sprintf('%s class', static::class));
throw new ImmutableException(\sprintf('%s class', static::class));
}

if (\is_array($name)) {
Expand Down Expand Up @@ -2503,7 +2503,7 @@ public static function __callStatic(string $method, array $parameters): mixed
}

if (static::isStrictModeEnabled()) {
throw new UnknownMethodException(sprintf('%s::%s', static::class, $method));
throw new UnknownMethodException(\sprintf('%s::%s', static::class, $method));
}

return null;
Expand Down
8 changes: 4 additions & 4 deletions tests/CarbonPeriod/IteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function testChangeEndDateDuringIteration()
$results = [];

foreach ($period as $key => $current) {
$results[] = sprintf('%s => %s', $key, $current->toDateString());
$results[] = \sprintf('%s => %s', $key, $current->toDateString());

if ($current->toDateString() === '2012-07-16') {
$period = $period->setEndDate($current);
Expand Down Expand Up @@ -228,7 +228,7 @@ public function testKeepIncreasingRecurrencesDuringIteration()
$results = [];

foreach ($period as $key => $current) {
$results[] = sprintf('%s => %s', $key, $current->toDateString());
$results[] = \sprintf('%s => %s', $key, $current->toDateString());

if ($recurrences < 4) {
$period->setRecurrences(++$recurrences);
Expand Down Expand Up @@ -259,7 +259,7 @@ public function testChangeStartDateDuringIteration()
$newStart = new Carbon('2012-07-03');

foreach ($period as $key => $current) {
$results[] = sprintf('%s => %s', $key, $current->toDateString());
$results[] = \sprintf('%s => %s', $key, $current->toDateString());

if ($current < $newStart) {
$period->setStartDate($newStart);
Expand Down Expand Up @@ -289,7 +289,7 @@ public function testChangeDateIntervalDuringIteration()
$results = [];

foreach ($period as $key => $current) {
$results[] = sprintf('%s => %s', $key, $current->toDateString());
$results[] = \sprintf('%s => %s', $key, $current->toDateString());

$period->setDateInterval('P3D');

Expand Down

0 comments on commit 139130a

Please sign in to comment.