src/BusinessTime/Schedule.php
Avoid using static access to class '\Carbon\CarbonImmutable' in method '__call'. Open
Open
$date = $this->passBusinessTimeMethods(CarbonImmutable::now());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'BusinessTime\BusinessTimeWrapper' in method 'create'. Open
Open
return new self(BusinessTimeWrapper::create($openingHours));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid excessively long variable names like $bindMacroContextMethod. Keep variable name length under 20. Open
Open
$bindMacroContextMethod = new ReflectionMethod($class, 'bindMacroContext');
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $bindMacroContextMethod. Keep variable name length under 20. Open
Open
$bindMacroContextMethod = $this->calculateBindMacroContext($class);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Line exceeds 120 characters; contains 246 characters Open
Open
* @method \Spatie\OpeningHours\OpeningHours getOpeningHours(CarbonInterface $date, $mode = null) Get the opening hours of the class/instance.
- Exclude checks
Line exceeds 120 characters; contains 260 characters Open
Open
* @method mixed safeCallOnOpeningHours(CarbonInterface $date, $method, ...$arguments) Call a method on the OpeningHours of the current instance.
- Exclude checks
Line exceeds 120 characters; contains 310 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface getMethodLoopOnHoliday(CarbonInterface $date) Loop on the current instance (or now if called statically) with a given method until it's not a holiday.
- Exclude checks
Line exceeds 120 characters; contains 256 characters Open
Open
* @method \Carbon\CarbonInterface|\Carbon\Carbon|\Carbon\CarbonImmutable currentOrPreviousBusinessDay(CarbonInterface $date) Sets the date to the current or previous business day.
- Exclude checks
Line exceeds 120 characters; contains 249 characters Open
Open
* @method $this|null observeHoliday(CarbonInterface $date, $holidayId = null, $observed = null, $self = null) Set a holiday as observed in the selected zone.
- Exclude checks
Line exceeds 120 characters; contains 301 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|null addHoliday(CarbonInterface $date, $region, $holiday, $holidayId = null, $name = null, $observed = null) Add a holiday to the holidays list of a region and optionally init its ID, name and observed state.
- Exclude checks
Line exceeds 120 characters; contains 269 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface addClosedHours(CarbonInterface $date, int $numberOfHours, int $options = 0) Add the given number of hours taking into account only closed time.
- Exclude checks
Line exceeds 120 characters; contains 236 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface nextOpen(CarbonInterface $date, $method = null) Go to the next open date and time.
- Exclude checks
Line exceeds 120 characters; contains 271 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface openOrNextCloseIncludingHolidays(CarbonInterface $date) Return current date-time if it's open, else go to the next close date
- Exclude checks
Line exceeds 120 characters; contains 283 characters Open
Open
* @method \Carbon\CarbonInterface|\Carbon\Carbon|\Carbon\CarbonImmutable nextBusinessDay(CarbonInterface $date) Sets the date to the next business day (neither a weekend day nor a holiday).
- Exclude checks
Line exceeds 120 characters; contains 249 characters Open
Open
* @method $this|null observeHolidays(CarbonInterface $date, $holidayId = null, $observed = null, $self = null) Set a holiday as observed in the selected zone.
- Exclude checks
Line exceeds 120 characters; contains 251 characters Open
Open
* @method array getHolidays(CarbonInterface $date, $region = null) Get the holidays for the current region selected.
- Exclude checks
Line exceeds 120 characters; contains 259 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface addBusinessInterval(CarbonInterface $date, bool $open, $interval = null, $unit = null, int $options = 0) Add the given interval taking into account only open time
- Exclude checks
Line exceeds 120 characters; contains 267 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface addOpenHours(CarbonInterface $date, int $numberOfHours, int $options = 0) Add the given number of hours taking into account only open time.
- Exclude checks
Line exceeds 120 characters; contains 272 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subOpenHours(CarbonInterface $date, int $numberOfHours, int $options = 0) Subtract the given number of hours taking into account only open time.
- Exclude checks
Line exceeds 120 characters; contains 281 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface closedOrNextOpen(CarbonInterface $date) Return current date-time if it's closed, else go to the next open date and time
- Exclude checks
Line exceeds 120 characters; contains 267 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface previousBusinessOpen(CarbonInterface $date) Go to the previous open date and time that is also not a holiday.
- Exclude checks
Line exceeds 120 characters; contains 309 characters Open
Open
* @method bool isBusinessClosed(CarbonInterface $date) Returns true if the business is closed or a holiday now (or current date and time) according to current
- Exclude checks
Line exceeds 120 characters; contains 244 characters Open
Open
* @method bool isHoliday(CarbonInterface $date) Checks the date to see if it is a holiday.
- Exclude checks
Line exceeds 120 characters; contains 260 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface addOpenTime(CarbonInterface $date, $interval = null, $unit = null, int $options = 0) Add the given interval taking into account only open time.
- Exclude checks
Line exceeds 120 characters; contains 289 characters Open
Open
* @method \Carbon\CarbonInterval diffAsBusinessInterval(CarbonInterface $date, $date = null, int $options = 0) Return an interval with open/closed business time between the current date and an other
- Exclude checks
Line exceeds 120 characters; contains 263 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subtractBusinessDays(CarbonInterface $date, $days = 1, $date = null) Subtract a given number of business days to the current date.
- Exclude checks
Line exceeds 120 characters; contains 260 characters Open
Open
* @method $this|null setHolidayGetter(CarbonInterface $date, callable $holidayGetter) Set the strategy to get the holiday ID from a date object.
- Exclude checks
Line exceeds 120 characters; contains 289 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|null setHolidayName(CarbonInterface $date, $holidayKey = null, $language = null, $name = null) Set/change the name of holiday by ID for a given language (or a list of languages).
- Exclude checks
Line exceeds 120 characters; contains 275 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface openOrPreviousBusinessClose(CarbonInterface $date) Return current date-time if it's open, else go to the previous close date
- Exclude checks
Line exceeds 120 characters; contains 243 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface addBusinessDay(CarbonInterface $date, $days = 1, $date = null) Add one business day to the current date.
- Exclude checks
Line exceeds 120 characters; contains 270 characters Open
Open
* @method array getMonthBusinessDays(CarbonInterface $date, $date = null) Get list of date objects for each business day in the current month.
- Exclude checks
Line exceeds 120 characters; contains 308 characters Open
Open
* @method bool isBusinessDay(CarbonInterface $date) Checks the date to see if it is a business day (extra workday or neither a weekend day nor a holiday).
- Exclude checks
Line exceeds 120 characters; contains 246 characters Open
Open
* @method string|null getObservedHolidaysZone(CarbonInterface $date) Get the selected zone for observed holidays.
- Exclude checks
Line exceeds 120 characters; contains 266 characters Open
Open
* @method $this|null setExtraWorkdayGetter(CarbonInterface $date, callable $workdayGetter) Set the strategy to get the extra workday ID from a date object.
- Exclude checks
Line exceeds 120 characters; contains 275 characters Open
Open
* @method string|false getHolidayId(CarbonInterface $date) Get the identifier of the current holiday or false if it's not a holiday.
- Exclude checks
Line exceeds 120 characters; contains 345 characters Open
Open
* @method mixed addHolidays(CarbonInterface $date, string $region, iterable $holidays = null, iterable $workingDays = null) Add a holiday to the holidays list of a region and optionally init their IDs, names and observed states (if provided as array-definitions).
- Exclude checks
Line exceeds 120 characters; contains 285 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface closedOrPreviousOpen(CarbonInterface $date) Return current date-time if it's closed, else go to the previous open date and time
- Exclude checks
Line exceeds 120 characters; contains 311 characters Open
Open
* @method bool isClosed(CarbonInterface $date) Returns true if the business is closed now (or current date and time) according to current opening hours.
- Exclude checks
Line exceeds 120 characters; contains 258 characters Open
Open
* @method int diffInBusinessDays(CarbonInterface $date, $other = null) Returns the difference between 2 dates in business days.
- Exclude checks
Line exceeds 120 characters; contains 250 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|null pushHoliday(CarbonInterface $date, $region, $holiday, $holidayId = null) Push a holiday to the holidays list of a region.
- Exclude checks
Line exceeds 120 characters; contains 285 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|null addExtraWorkday(CarbonInterface $date, $region, $workday, $workdayId = null, $name = null) Add a workday to the workdays list of a region and optionally init its ID and name.
- Exclude checks
Line exceeds 120 characters; contains 236 characters Open
Open
* @method array unpackHoliday(CarbonInterface $date, $holiday, $name = null, $observed = null) Unpack a holiday array definition.
- Exclude checks
Line exceeds 120 characters; contains 270 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrNextBusinessOpen(CarbonInterface $date) Return current date-time if it's open, else go to the next open date
- Exclude checks
Line exceeds 120 characters; contains 263 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface nextBusinessClose(CarbonInterface $date) Go to the next close date and time or next holiday if sooner.
- Exclude checks
Line exceeds 120 characters; contains 271 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface previousCloseIncludingHolidays(CarbonInterface $date) Go to the previous close date and time or previous holiday if sooner.
- Exclude checks
Line exceeds 120 characters; contains 291 characters Open
Open
* @method bool isClosedOn($day) Returns true if the business is closed on a given day according to current opening hours.
- Exclude checks
Line exceeds 120 characters; contains 237 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface nextClose(CarbonInterface $date, $method = null) Go to the next close date and time.
- Exclude checks
Line exceeds 120 characters; contains 253 characters Open
Open
* @method $this|null unobserveHoliday(CarbonInterface $date, $holidayId = null, $observed = null, $self = null) Set a holiday as not observed in the selected zone.
- Exclude checks
Line exceeds 120 characters; contains 276 characters Open
Open
* @method array|null getHolidayData(CarbonInterface $date) Get stored data set for the current holiday or null if it's not a holiday.
- Exclude checks
Line exceeds 120 characters; contains 286 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrPreviousClose(CarbonInterface $date) Return current date-time if it's closed, else go to the previous close date and time
- Exclude checks
Line exceeds 120 characters; contains 267 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface previousOpenExcludingHolidays(CarbonInterface $date) Go to the previous open date and time that is also not a holiday.
- Exclude checks
Line exceeds 120 characters; contains 271 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface previousBusinessClose(CarbonInterface $date) Go to the previous close date and time or previous holiday if sooner.
- Exclude checks
Line exceeds 120 characters; contains 248 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subBusinessDay(CarbonInterface $date, $days = 1, $date = null) Subtract one business day to the current date.
- Exclude checks
Line exceeds 120 characters; contains 244 characters Open
Open
* @method bool isExtraWorkday(CarbonInterface $date) Checks the date to see if it is a holiday.
- Exclude checks
Line exceeds 120 characters; contains 296 characters Open
Open
* @method array swapDateTimeParam(CarbonInterface $date, $target, $date, $defaultValue) Store a first variable as Carbon instance into the second variable if the first one is a date.
- Exclude checks
Line exceeds 120 characters; contains 297 characters Open
Open
* @method float diffInBusinessSeconds(CarbonInterface $date, $date = null, int $options = 0) Return a number of seconds with open/closed business time between the current date and an other
- Exclude checks
Line exceeds 120 characters; contains 312 characters Open
Open
* @method bool isOpenExcludingHolidays(CarbonInterface $date) Returns true if the business is open and not a holiday now (or current date and time) according to current
- Exclude checks
Line exceeds 120 characters; contains 260 characters Open
Open
* @method $this|null setHolidayObserveStatus(CarbonInterface $date, $holidayId, $observed, $self = null) Set a holiday as observed/unobserved in the selected zone.
- Exclude checks
Line exceeds 120 characters; contains 252 characters Open
Open
* @method $this|null observeAllHolidays(CarbonInterface $date, $holidayId = null, $observed = null, $self = null) Set all holidays as observed in the selected zone.
- Exclude checks
Line exceeds 120 characters; contains 241 characters Open
Open
* @method array getHolidayNamesDictionary(CarbonInterface $date, $locale) Get the holidays in the given language.
- Exclude checks
Line exceeds 120 characters; contains 248 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|null pushToBDList(CarbonInterface $date, string $list, $region, $day, $dayId = null) Push a day into a given list list of a region.
- Exclude checks
Line exceeds 120 characters; contains 269 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrPreviousOpenExcludingHolidays(CarbonInterface $date) Return current date-time if it's open, else go to the previous open
- Exclude checks
Line exceeds 120 characters; contains 263 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface nextOpenExcludingHolidays(CarbonInterface $date) Go to the next open date and time that is also not a holiday.
- Exclude checks
Line exceeds 120 characters; contains 309 characters Open
Open
* @method bool isClosedIncludingHolidays(CarbonInterface $date) Returns true if the business is closed or a holiday now (or current date and time) according to current
- Exclude checks
Line exceeds 120 characters; contains 252 characters Open
Open
* @method $this|null unobserveAllHolidays(CarbonInterface $date, $holidayId = null, $observed = null, $self = null) Set all holidays as observed in the selected zone.
- Exclude checks
Line exceeds 120 characters; contains 268 characters Open
Open
* @method bool isDateTimeInstance(CarbonInterface $date, $value) Return true if the given value is a DateTime or DateTimeInterface.
- Exclude checks
Line exceeds 120 characters; contains 287 characters Open
Open
* @method mixed setMaxIteration(CarbonInterface $date, int $maximum) Set the maximum of loop turns to run before throwing an exception where trying to add
- Exclude checks
Line exceeds 120 characters; contains 277 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface applyBusinessInterval(CarbonInterface $date, bool $inverted, bool $open, $interval = null, $unit = null, int $options = 0) Shift current time with a given interval taking into account only open time
- Exclude checks
Line exceeds 120 characters; contains 279 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrNextOpen(CarbonInterface $date) Return current date-time if it's open, else go to the next open date and time
- Exclude checks
Line exceeds 120 characters; contains 249 characters Open
Open
* @method $this|null resetOpeningHours(CarbonInterface $date) Reset the opening hours for the class/instance.
- Exclude checks
Line exceeds 120 characters; contains 263 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subBusinessDays(CarbonInterface $date, $days = 1, $date = null) Subtract a given number of business days to the current date.
- Exclude checks
Line exceeds 120 characters; contains 291 characters Open
Open
* @method $this|null setBusinessDayChecker(CarbonInterface $date, callable $checkCallback = null) Checks the date to see if it is a business day (neither a weekend day nor a holiday).
- Exclude checks
Line exceeds 120 characters; contains 224 characters Open
Open
* @method mixed setHolidays(CarbonInterface $date, $region, $holidays) Set the holidays list.
- Exclude checks
Line exceeds 120 characters; contains 224 characters Open
Open
* @method mixed setExtraWorkdays(CarbonInterface $date, $region, $holidays) Set the holidays list.
- Exclude checks
Line exceeds 120 characters; contains 226 characters Open
Open
* @method mixed resetHolidays(CarbonInterface $date) Reset the holidays list.
- Exclude checks
Line exceeds 120 characters; contains 249 characters Open
Open
* @method $this|null setHolidayDataById(CarbonInterface $date, string $id, array $data) Set stored data set for the a given holiday ID.
- Exclude checks
Line exceeds 120 characters; contains 267 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subClosedTime(CarbonInterface $date, $interval = null, $unit = null, int $options = 0) Subtract the given interval taking into account only closed time.
- Exclude checks
Line exceeds 120 characters; contains 274 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subClosedHours(CarbonInterface $date, int $numberOfHours, int $options = 0) Subtract the given number of hours taking into account only closed time.
- Exclude checks
Line exceeds 120 characters; contains 282 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrNextClose(CarbonInterface $date) Return current date-time if it's closed, else go to the next close date and time
- Exclude checks
Line exceeds 120 characters; contains 271 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface openOrNextBusinessClose(CarbonInterface $date) Return current date-time if it's open, else go to the next close date
- Exclude checks
Line exceeds 120 characters; contains 248 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subtractBusinessDay(CarbonInterface $date, $days = 1, $date = null) Subtract one business day to the current date.
- Exclude checks
Line exceeds 120 characters; contains 307 characters Open
Open
* @method $this|null setObservedHolidaysZone(CarbonInterface $date, $zone, $self = null) Set the selected zone for observed holidays. So next observe methods will be saved and considered in this
- Exclude checks
Line exceeds 120 characters; contains 263 characters Open
Open
* @method bool checkObservedHoliday(CarbonInterface $date, $holidayId = null) Check if a given holiday ID is observed in the selected zone.
- Exclude checks
Line exceeds 120 characters; contains 234 characters Open
Open
* @method array getHolidaysAvailableRegions(CarbonInterface $date) Get the current holidays region.
- Exclude checks
Line exceeds 120 characters; contains 234 characters Open
Open
* @method null|string getHolidaysRegion(CarbonInterface $date) Get the current holidays region.
- Exclude checks
Line exceeds 120 characters; contains 251 characters Open
Open
* @method array getExtraWorkdays(CarbonInterface $date, $region = null) Get the holidays for the current region selected.
- Exclude checks
Line exceeds 120 characters; contains 250 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|null pushWorkday(CarbonInterface $date, $region, $workday, $workdayId = null) Push a workday to the workdays list of a region.
- Exclude checks
Line exceeds 120 characters; contains 260 characters Open
Open
* @method array checkHoliday(CarbonInterface $date, $holiday, $holidayId, $name = null, $observed = null) Check a holiday definition and unpack it if it's an array.
- Exclude checks
Line exceeds 120 characters; contains 287 characters Open
Open
* @method mixed getMaxIteration(CarbonInterface $date) Get the maximum of loop turns to run before throwing an exception where trying to add
- Exclude checks
Line exceeds 120 characters; contains 259 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subBusinessInterval(CarbonInterface $date, bool $open, $interval = null, $unit = null, int $options = 0) Add the given interval taking into account only open time
- Exclude checks
Line exceeds 120 characters; contains 276 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subClosedMinutes(CarbonInterface $date, int $numberOfMinutes, int $options = 0) Subtract the given number of minutes taking into account only closed time.
- Exclude checks
Line exceeds 120 characters; contains 274 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrPreviousBusinessOpen(CarbonInterface $date) Return current date-time if it's open, else go to the previous open date
- Exclude checks
Line exceeds 120 characters; contains 273 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrNextCloseIncludingHolidays(CarbonInterface $date) Return current date-time if it's closed, else go to the next close date
- Exclude checks
Line exceeds 120 characters; contains 247 characters Open
Open
* @method $this|null setOpeningHours(CarbonInterface $date, $openingHours) Set the opening hours for the class/instance.
- Exclude checks
Line exceeds 120 characters; contains 314 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|bool getCalleeAsMethod(CarbonInterface $date, $method = null) Get a closure to be executed on OpeningHours on the current instance (or now if called globally) that should
- Exclude checks
Line exceeds 120 characters; contains 286 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface getTernaryMethod(CarbonInterface $date) Get a method that return current date-time if $testMethod applied on it return true,
- Exclude checks
Line exceeds 120 characters; contains 294 characters Open
Open
* @method \Carbon\CarbonInterface|\Carbon\Carbon|\Carbon\CarbonImmutable currentOrNextBusinessDay(CarbonInterface $date) Sets the date to the current or next business day (neither a weekend day nor a holiday).
- Exclude checks
Line exceeds 120 characters; contains 291 characters Open
Open
* @method string|false getExtraWorkdayId(CarbonInterface $date) Get the identifier of the current special workday or false if it's not a special workday.
- Exclude checks
Line exceeds 120 characters; contains 271 characters Open
Open
* @method callable getYearHolidaysNextFunction(CarbonInterface $date, $year = null, $type = null, string $getDays = 'getHolidays') Get a next() callback to call to iterate over holidays of a year.
- Exclude checks
Line exceeds 120 characters; contains 269 characters Open
Open
* @method mixed setHolidaysRegion(CarbonInterface $date, $region) Set the holidays region (see src/Cmixin/Holidays for examples).
- Exclude checks
Line exceeds 120 characters; contains 249 characters Open
Open
* @method array|null getHolidayDataById(CarbonInterface $date, string $id) Get stored data set for the a given holiday ID.
- Exclude checks
Line exceeds 120 characters; contains 265 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subOpenTime(CarbonInterface $date, $interval = null, $unit = null, int $options = 0) Subtract the given interval taking into account only open time.
- Exclude checks
Line exceeds 120 characters; contains 262 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface addClosedTime(CarbonInterface $date, $interval = null, $unit = null, int $options = 0) Add the given interval taking into account only closed time.
- Exclude checks
Line exceeds 120 characters; contains 274 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface subOpenMinutes(CarbonInterface $date, int $numberOfMinutes, int $options = 0) Subtract the given number of minutes taking into account only open time.
- Exclude checks
Line exceeds 120 characters; contains 272 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface closedOrNextOpenExcludingHolidays(CarbonInterface $date) Return current date-time if it's closed, else go to the next open date
- Exclude checks
Line exceeds 120 characters; contains 277 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrPreviousBusinessClose(CarbonInterface $date) Return current date-time if it's closed, else go to the previous close date
- Exclude checks
Line exceeds 120 characters; contains 297 characters Open
Open
* @method float diffInBusinessMinutes(CarbonInterface $date, $date = null, int $options = 0) Return a number of minutes with open/closed business time between the current date and an other
- Exclude checks
Line exceeds 120 characters; contains 289 characters Open
Open
* @method bool isOpenOn($day) Returns true if the business is open on a given day according to current opening hours.
- Exclude checks
Line exceeds 120 characters; contains 240 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface previousOpen(CarbonInterface $date, $method = null) Go to the previous open date and time.
- Exclude checks
Line exceeds 120 characters; contains 255 characters Open
Open
* @method int getBusinessDaysInMonth(CarbonInterface $date, $date = null) Get the number of business days in the current month.
- Exclude checks
Line exceeds 120 characters; contains 287 characters Open
Open
* @method \Carbon\CarbonInterface|\Carbon\Carbon|\Carbon\CarbonImmutable previousBusinessDay(CarbonInterface $date) Sets the date to the previous business day (neither a weekend day nor a holiday).
- Exclude checks
Line exceeds 120 characters; contains 251 characters Open
Open
* @method array getBDDaysList(CarbonInterface $date, string $list, $region = null) Get the holidays for the current region selected.
- Exclude checks
Line exceeds 120 characters; contains 282 characters Open
Open
* @method $this|null setHolidayData(CarbonInterface $date, array $data) Set stored data set for the current holiday, does nothing if it's not a holiday.
- Exclude checks
Line exceeds 120 characters; contains 276 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface closedOrPreviousBusinessOpen(CarbonInterface $date) Return current date-time if it's closed, else go to the previous open date
- Exclude checks
Line exceeds 120 characters; contains 276 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface closedOrPreviousOpenExcludingHolidays(CarbonInterface $date) Return current date-time if it's closed, else go to the previous open date
- Exclude checks
Line exceeds 120 characters; contains 263 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface nextBusinessOpen(CarbonInterface $date) Go to the next open date and time that is also not a holiday.
- Exclude checks
Line exceeds 120 characters; contains 263 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface nextCloseIncludingHolidays(CarbonInterface $date) Go to the next close date and time or next holiday if sooner.
- Exclude checks
Line exceeds 120 characters; contains 309 characters Open
Open
* @method bool isOpen(CarbonInterface $date) Returns true if the business is open now (or current date and time) according to current opening hours.
- Exclude checks
Line exceeds 120 characters; contains 275 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface openOrPreviousCloseIncludingHolidays(CarbonInterface $date) Return current date-time if it's open, else go to the previous close date
- Exclude checks
Line exceeds 120 characters; contains 306 characters Open
Open
* @method string|false getHolidayName(CarbonInterface $date, $date = null, $locale = null) Get the name of the current holiday (using the locale given in parameter or the current date locale)
- Exclude checks
Line exceeds 120 characters; contains 236 characters Open
Open
* @method string standardizeHolidaysRegion(CarbonInterface $date, $region) Return a standardized region name.
- Exclude checks
Line exceeds 120 characters; contains 269 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface addOpenMinutes(CarbonInterface $date, int $numberOfMinutes, int $options = 0) Add the given number of minutes taking into account only open time.
- Exclude checks
Line exceeds 120 characters; contains 272 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface closedOrNextBusinessOpen(CarbonInterface $date) Return current date-time if it's closed, else go to the next open date
- Exclude checks
Line exceeds 120 characters; contains 270 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrNextOpenExcludingHolidays(CarbonInterface $date) Return current date-time if it's open, else go to the next open date
- Exclude checks
Line exceeds 120 characters; contains 258 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface addBusinessDays(CarbonInterface $date, $days = 1, $date = null) Add a given number of business days to the current date.
- Exclude checks
Line exceeds 120 characters; contains 309 characters Open
Open
* @method \Carbon\CarbonInterval|float diffInBusinessUnit(CarbonInterface $date, string $unit, $date = null, int $options = 0) Return an interval/count of given unit with open/closed business time between the current date and an other
- Exclude checks
Line exceeds 120 characters; contains 241 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface previousClose(CarbonInterface $date, $method = null) Go to the previous close date and time.
- Exclude checks
Line exceeds 120 characters; contains 293 characters Open
Open
* @method $this|null getObserveHolidayMethod(CarbonInterface $date, $holidayId = null, $observed = null, $self = null) Set a holiday as observed/unobserved in the selected zone (can take array of holidays).
- Exclude checks
Line exceeds 120 characters; contains 253 characters Open
Open
* @method $this|null unobserveHolidays(CarbonInterface $date, $holidayId = null, $observed = null, $self = null) Set a holiday as not observed in the selected zone.
- Exclude checks
Line exceeds 120 characters; contains 274 characters Open
Open
* @method bool isObservedHoliday(CarbonInterface $date, $holidayId = null, $date = null) Checks the date to see if it is a holiday observed in the selected zone.
- Exclude checks
Line exceeds 120 characters; contains 275 characters Open
Open
* @method string|false getDBDayId(CarbonInterface $date, string $getDays = 'getHolidays') Get the identifier of the current holiday or false if it's not a holiday.
- Exclude checks
Line exceeds 120 characters; contains 283 characters Open
Open
* @method array getYearHolidays(CarbonInterface $date, $year = null, $type = null, string $getDays = 'getHolidays') Get the holidays dates for a given year (current year if no parameter given).
- Exclude checks
Line exceeds 120 characters; contains 271 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface addClosedMinutes(CarbonInterface $date, int $numberOfMinutes, int $options = 0) Add the given number of minutes taking into account only closed time.
- Exclude checks
Line exceeds 120 characters; contains 273 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrNextBusinessClose(CarbonInterface $date) Return current date-time if it's closed, else go to the next close date
- Exclude checks
Line exceeds 120 characters; contains 277 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrPreviousCloseIncludingHolidays(CarbonInterface $date) Return current date-time if it's closed, else go to the previous close date
- Exclude checks
Line exceeds 120 characters; contains 283 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface currentOrPreviousOpen(CarbonInterface $date) Return current date-time if it's open, else go to the previous open date and time
- Exclude checks
Line exceeds 120 characters; contains 295 characters Open
Open
* @method float diffInBusinessHours(CarbonInterface $date, $date = null, int $options = 0) Return a number of hours with open/closed business time between the current date and an other
- Exclude checks
Line exceeds 120 characters; contains 312 characters Open
Open
* @method bool isBusinessOpen(CarbonInterface $date) Returns true if the business is open and not a holiday now (or current date and time) according to current
- Exclude checks
Line exceeds 120 characters; contains 267 characters Open
Open
* @method \Spatie\OpeningHours\OpeningHoursForDay getCurrentDayOpeningHours(CarbonInterface $date) Get OpeningHoursForDay instance of the current instance or class.
- Exclude checks
Line exceeds 120 characters; contains 271 characters Open
Open
* @method \Spatie\OpeningHours\TimeRange|bool getCurrentOpenTimeRange(CarbonInterface $date) Get current open time range as TimeRange instance or false if closed.
- Exclude checks
Line exceeds 120 characters; contains 280 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface openOrNextClose(CarbonInterface $date) Return current date-time if it's open, else go to the next close date and time
- Exclude checks
Line exceeds 120 characters; contains 272 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|bool getCurrentBusinessOpenTimeRangeEnd(CarbonInterface $date, $method = null) Get current open time range end as Carbon instance or false if closed.
- Exclude checks
Line exceeds 120 characters; contains 272 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|bool getCurrentOpenTimeRangeEnd(CarbonInterface $date, $method = null) Get current open time range end as Carbon instance or false if closed.
- Exclude checks
Line exceeds 120 characters; contains 284 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface openOrPreviousClose(CarbonInterface $date) Return current date-time if it's open, else go to the previous close date and time
- Exclude checks
Line exceeds 120 characters; contains 271 characters Open
Open
* @method \Carbon\CarbonPeriod|bool getCurrentOpenTimePeriod(CarbonInterface $date, $interval = null) Get current open time range as TimeRange instance or false if closed.
- Exclude checks
Line exceeds 120 characters; contains 274 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|bool getCurrentOpenTimeRangeStart(CarbonInterface $date, $method = null) Get current open time range start as Carbon instance or false if closed.
- Exclude checks
Line exceeds 120 characters; contains 285 characters Open
Open
* @method \Carbon\Carbon|\Carbon\CarbonImmutable|\Carbon\CarbonInterface|bool getCurrentBusinessTimeRangeStart(CarbonInterface $date, $method = null) Get current open time range start as Carbon instance or false if closed or holiday.
- Exclude checks
Line exceeds 120 characters; contains 294 characters Open
Open
* @method \Spatie\OpeningHours\TimeRange[] getCurrentOpenTimeRanges(CarbonInterface $date) Get open time ranges as array of TimeRange instances that matches the current date and time.
- Exclude checks