renovate[bot] eb9b8bdf81
chore(deps): update dependency friendsofphp/php-cs-fixer to <3.85.2 (#3188)
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
|
[friendsofphp/php-cs-fixer](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer)
| `<3.64.1` -> `<3.85.2` |
[![age](https://developer.mend.io/api/mc/badges/age/packagist/friendsofphp%2fphp-cs-fixer/3.85.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/packagist/friendsofphp%2fphp-cs-fixer/3.64.0/3.85.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>PHP-CS-Fixer/PHP-CS-Fixer (friendsofphp/php-cs-fixer)</summary>

###
[`v3.85.1`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3851)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.85.0...v3.85.1)

- chore: update legacy deps
([#&#8203;8902](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8902))

###
[`v3.85.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3850)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.84.0...v3.85.0)

- feat: `ArrayIndentationFixer` - handle closures inside attributes
([#&#8203;8888](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8888))
- feat: `NullableTypeDeclarationFixer` - support final promoted
properties
([#&#8203;8885](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8885))
- feat: `OperatorLinebreakFixer` - support pipe operator
([#&#8203;8891](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8891))
- feat: `PhpdocTypesFixer` - support multiline array shapes
([#&#8203;8893](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8893))
- fix: always reach 100% of checked files
([#&#8203;8861](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8861))
- fix: `BracesPositionFixer` - handle property hooks correctly
([#&#8203;8886](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8886))
- fix: `NullableTypeDeclarationFixer` - handle abstract and final
properties
([#&#8203;8876](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8876))
- fix: `PhpdocLineSpanFixer` - handle promoted properties
([#&#8203;8897](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8897))
- fix: `PhpUnitDataProviderNameFixer` - fix for multiple providers
defined by attributes for one test method
([#&#8203;8849](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8849))
- fix: `TernaryOperatorSpacesFixer` - handle `instanceof static`
([#&#8203;8879](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8879))
- fix: `TypeDeclarationSpacesFixer` - handle asymmetric visibility and
final properties
([#&#8203;8900](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8900))
- chore: add initial PHP 8.5 integration test
([#&#8203;8871](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8871))
- chore: add tests for public API methods
([#&#8203;8895](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8895))
- chore: apply changes from `PhpdocTypesFixer` for multiline array
shapes
([#&#8203;8894](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8894))
- chore: baseline files without error count
([#&#8203;8870](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8870))
- chore: cleanup `PhpCsFixer\DocBlock\Annotation`
([#&#8203;8892](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8892))
- chore: Command name/descriptions - use attribute and static properties
([#&#8203;8862](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8862))
- chore: Commands - unify way to define help content
([#&#8203;8881](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8881))
- chore: ConfigurationResolver - add few missing v4 TODOs
([#&#8203;8882](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8882))
- chore: fix `booleanNot.exprNotBoolean` errors
([#&#8203;8869](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8869))
- chore: fix/optimize some phpdocs
([#&#8203;8889](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8889))
- chore: more unification of PHP CS Fixer naming
([#&#8203;8854](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8854))
- chore: PHPStan baseline - use
`shipmonk/phpstan-baseline-per-identifier`
([#&#8203;8844](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8844))
- chore: remove dead code
([#&#8203;8896](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8896))
- chore: remove unused constants
([#&#8203;8864](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8864))
- chore: remove useless `@var` annotations
([#&#8203;8867](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8867))
- chore: simplify `ClassDefinitionFixer`
([#&#8203;8868](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8868))
- chore: unify usage of image versions to not mention minor
([#&#8203;8860](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8860))
- chore: update PHPStan
([#&#8203;8898](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8898))
- chore: update PHPStan extension for `Preg::match`
([#&#8203;8872](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8872))
- chore: wrong return values in `ErrorsManager`
([#&#8203;8863](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8863))
- chore: `OrderedInterfacesFixer` - make code more PHPStan friendly
([#&#8203;8866](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8866))
- chore: `Token` - add `@phpstan-assert-if-true`
([#&#8203;8865](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8865))
- deps: bump phpstan/phpstan from 2.1.17 to 2.1.18 in /dev-tools in the
phpstan group
([#&#8203;8859](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8859))
- deps: bump the phpstan group in /dev-tools with 4 updates
([#&#8203;8890](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8890))
- docs: better document reprecated rule sets
([#&#8203;8878](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8878))
- docs: cleanup docs for PHP 7
([#&#8203;8873](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8873))
- docs: cleanup docs for PHP < 7.4
([#&#8203;8855](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8855))
- docs: ListSetsCommand,FixCommand - document possible formats in
Command's definitions
([#&#8203;8880](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8880))
- DX: Explicitly prevent touching non-monolithic files
([#&#8203;6517](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/6517))

###
[`v3.84.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3840)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.83.0...v3.84.0)

- feat: Introduce `NoUselessPrintfFixer`
([#&#8203;8820](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8820))
- feat: `CastSpacesFixer` - support `(void)` cast
([#&#8203;8851](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8851))
- feat: `NewExpressionParenthesesFixer` - add to `PHP84MigrationSet`
([#&#8203;8788](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8788))
- feat: `VisibilityRequiredFixer` - support final promoted properties
([#&#8203;8835](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8835))
- fix: `PhpdocToParamTypeFixer` - do not convert types from
`phpstan-type`, `phpstan-import-type`, `psalm-type` and
`psalm-import-type`
([#&#8203;8842](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8842))
- fix: `PhpdocToPropertyTypeFixer` - do not convert types from
`phpstan-type`, `phpstan-import-type`, `psalm-type` and
`psalm-import-type`
([#&#8203;8847](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8847))
- fix: `PhpdocToReturnTypeFixer` - do not convert types from
`phpstan-type`, `phpstan-import-type`, `psalm-type` and
`psalm-import-type`
([#&#8203;8846](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8846))
- chore: introduce FCT for few missing tokens
([#&#8203;8845](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8845))
- chore: remove useless static variables for const content
([#&#8203;8836](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8836))
- chore: simplify `isGivenKind`/`equals`/`equalsAll` calls
([#&#8203;8843](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8843))
- docs: Support for new PHP version
([#&#8203;8780](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8780))

###
[`v3.83.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3830)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.82.2...v3.83.0)

- feat: Suppress enable parallel runner message when only 1 core is
available
([#&#8203;8833](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8833))
- fix: BracesPositionFixer - fix performance issue for massive files
with CT::T\_CURLY\_CLOSE
([#&#8203;8830](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8830))
- fix: `NoUnreachableDefaultArgumentValueFixer` - do not crash on
property hook
([#&#8203;8838](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8838))
- chore: Add CS commit to .git-blame-ignore-revs
- chore: apply native\_constant\_invocation for build-in consts
([#&#8203;8837](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8837))
- chore: configure native\_constant\_invocation
([#&#8203;8840](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8840))
- chore: early compat check with Symfony 8
([#&#8203;8827](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8827))
- chore: `FullyQualifiedStrictTypesFixer` - reduce function calls
([#&#8203;8834](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8834))
- CI: mark jobs allow-to-fail declarative, instead of imperative check
([#&#8203;8829](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8829))

###
[`v3.82.2`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3822)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.82.1...v3.82.2)

- fix: `ClassAttributesSeparationFixer` - handle method `get` aliased in
trait import
([#&#8203;8822](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8822))
- fix: `LowercaseStaticReferenceFixer` - do not touch enum's cases
([#&#8203;8824](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8824))
- fix: `StatementIndentationFixer` - multi constant statement containing
array
([#&#8203;8825](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8825))
- fix: `VisibilityRequiredFixer` - handle promoted property with
visibility and reference, but without type
([#&#8203;8823](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8823))

###
[`v3.82.1`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3821)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.82.0...v3.82.1)

- fix: `OrderedClassElementsFixer` - handle property hooks
([#&#8203;8817](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8817))
- fix: `SingleClassElementPerStatementFixer` - fix for property hooks
([#&#8203;8816](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8816))

###
[`v3.82.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3820)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.81.0...v3.82.0)

- chore: cleanup `FCTTest`
([#&#8203;8808](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8808))
- chore: PhpdocOrderFixer.php - CPU optimization
([#&#8203;8812](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8812))
- deps: update box
([#&#8203;8795](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8795))
- docs: fix whitespace around code examples and reference sections in
rules' docs
([#&#8203;8810](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8810))
- feat: `MagicConstantCasingFixer` - support `__PROPERTY__`
([#&#8203;8809](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8809))
- feat: `PhpUnitDataProviderNameFixer` - support data providers defined
by both annotation and attribute for the same test
([#&#8203;8811](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8811))
- fix: `PhpdocToParamTypeFixer` - always handle reference in PHPDoc
([#&#8203;8813](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8813))

###
[`v3.81.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3810)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.80.0...v3.81.0)

- feat: `VisibilityRequiredFixer` - handle more than only the first
promoted property
([#&#8203;8801](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8801))
- fix: `BracesPositionFixer` - do not crash when variable is terminated
by PHP close tag
([#&#8203;8804](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8804))
- fix: `PhpUnitDataProviderMethodOrderFixer` - handle data provider
defined by both annotation and attribute
([#&#8203;8805](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8805))
- fix: `PhpUnitInternalClassFixer` - skip adding `@internal` on
instantiation of anonymous classes
([#&#8203;8807](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8807))
- fix: `VisibilityRequiredFixer` - handle promoted parameter passed by
reference
([#&#8203;8799](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8799))
- chore: add automatically to milestone "PHP 8.5 initial compatibility"
if label is "topic/PHP8.5"
([#&#8203;8806](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8806))
- chore: fail "Deployment checks" if any job from `tests` failed
([#&#8203;8792](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8792))
- docs: update docs about --allow-unsupported-php-version
([#&#8203;8796](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8796))

###
[`v3.80.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3800)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.79.0...v3.80.0)

- feat: PHP 8.4 compatibility support
([#&#8203;8300](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8300))

###
[`v3.79.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3790)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.78.1...v3.79.0)

- chore: `VisibilityRequiredFixerTest` - run tests in correct PHP
version
([#&#8203;8790](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8790))
- feat: `BracesPositionFixer` - do not touch one-line properties with
hooks
([#&#8203;8785](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8785))
- feat: `PhpUnitDataProvider(.+)Fixer` - support attributes
([#&#8203;8197](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8197))

###
[`v3.78.1`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3781)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.78.0...v3.78.1)

- fix: `VisibilityRequiredFixer` - do not add `public` incorrectly
([#&#8203;8787](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8787))

###
[`v3.78.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3780)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.77.0...v3.78.0)

- chore: `VisibilityRequiredFixer` - document behaviour for asymmetric
visibility with only set-visibility
([#&#8203;8783](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8783))
- feat: `BracesPositionFixer` - support property hooks
([#&#8203;8782](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8782))
- feat: `VisibilityRequiredFixer` - support promoted property without
visibility
([#&#8203;8773](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8773))
- fix: `NativeFunctionInvocationFixer` - fix global function `set`
called in array key
([#&#8203;8568](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8568))
- fix: `NoBreakCommentFixer` - handle function having return type
([#&#8203;8767](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8767))
- fix: `StatementIndentationFixer` - handle functions `set` and `get`
(like property hooks, but not)
([#&#8203;8576](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8576))
- fix: `StaticPrivateMethodFixer` - handle nested calls
([#&#8203;8768](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8768))

###
[`v3.77.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3770)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.76.0...v3.77.0)

- chore: add automatically to milestone "PHP 8.4 initial compatibility"
if label is "topic/PHP8.4"
([#&#8203;8770](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8770))
- chore: Add CS commit to .git-blame-ignore-revs
- chore: fix adding automatically to milestone "PHP 8.4 initial
compatibility" if label is "topic/PHP8.4"
([#&#8203;8775](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8775))
- chore: fix adding automatically to milestone "PHP 8.4 initial
compatibility" if label is "topic/PHP8.4"
([#&#8203;8776](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8776))
- chore: move all indicators to analyzers
([#&#8203;8772](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8772))
- chore: move PHP-compat integration tests
([#&#8203;8781](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8781))
- chore: partially apply NoExtraBlankLinesFixer:tokens.comma
([#&#8203;8762](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8762))
- chore: reconfigure phpdoc\_order in local config
([#&#8203;8220](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8220))
- feat: PhpdocOrderFixer - extend support for phpstan and psalm
annotations
([#&#8203;8777](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8777))
- feat: support anonymous classes extending `TestCase` in PHPUnit fixers
([#&#8203;8707](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8707))
- feat: `CommentToPhpdocFixer` and `PhpdocToCommentFixer` - support
asymmetric visibility
([#&#8203;8774](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8774))
- feat: `NoEmptyStatementFixer` - support abstract property hooks
([#&#8203;8766](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8766))
- feat: `NullableTypeDeclarationForDefaultNullValueFixer` - support
asymmetric visibility in the constructor
([#&#8203;8604](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8604))
- feat: `ProtectedToPrivateFixer` - add support for promoted properties
([#&#8203;8608](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8608))
- fix: `PhpUnitAttributesFixer` - correctly remove annotations when
configured `['keep_annotations' => false]`
([#&#8203;8577](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8577))
- fix: `ProtectedToPrivateFixer` - fix asymmetric visibility with only
set visibility
([#&#8203;8763](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8763))

###
[`v3.76.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3760)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.75.0...v3.76.0)

- chore(release): bump php ci alpine version
([#&#8203;8581](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8581))
- chore: add missing priority test for `BracesPositionFixer` and
`MultilinePromotedPropertiesFixer`
([#&#8203;8596](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8596))
- chore: add more assertions in tests
([#&#8203;8740](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8740))
- chore: bump dependencies version to maximum for non-newest MAJOR
version
([#&#8203;8753](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8753))
- chore: cast types in tests
([#&#8203;8742](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8742))
- chore: cleanup booleans use in tests
([#&#8203;8738](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8738))
- chore: cleanup code in tests
([#&#8203;8745](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8745))
- chore: cleanup PsrAutoloadingFixerTest.php keywords handling, as
always defined currently
([#&#8203;8730](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8730))
- chore: cleanup `AlignMultilineCommentFixerTest`
([#&#8203;8688](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8688))
- chore: cleanup `BinaryOperatorSpacesFixerTest`
([#&#8203;8687](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8687))
- chore: cleanup `BlankLineBeforeStatementFixerTest`
([#&#8203;8685](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8685))
- chore: cleanup `ClassDefinitionFixerTest`
([#&#8203;8684](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8684))
- chore: cleanup `ClassDefinitionFixer`
([#&#8203;8580](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8580))
- chore: cleanup `ConcatSpaceFixerTest`
([#&#8203;8683](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8683))
- chore: cleanup `DoctrineAnnotationArrayAssignmentFixerTest`
([#&#8203;8621](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8621))
- chore: cleanup `DoctrineAnnotationBracesFixerTest`
([#&#8203;8623](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8623))
- chore: cleanup `DoctrineAnnotationIndentationFixerTest`
([#&#8203;8620](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8620))
- chore: cleanup `DoctrineAnnotationSpacesFixerTest`
([#&#8203;8624](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8624))
- chore: cleanup `EchoTagSyntaxFixerTest`
([#&#8203;8681](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8681))
- chore: cleanup `file_get_contents` return types
([#&#8203;8735](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8735))
- chore: cleanup `FunctionDeclarationFixerTest`
([#&#8203;8680](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8680))
- chore: cleanup `FunctionToConstantFixerTest`
([#&#8203;8618](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8618))
- chore: cleanup `GeneralPhpdocTagRenameFixerTest`
([#&#8203;8627](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8627))
- chore: cleanup `GlobalNamespaceImportFixerTest`
([#&#8203;8679](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8679))
- chore: cleanup `HeaderCommentFixerTest`
([#&#8203;8677](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8677))
- chore: cleanup `HeaderCommentFixerTest` (restore `@requires` for PHP
8.1)
([#&#8203;8678](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8678))
- chore: cleanup `IncrementStyleFixerTest`
([#&#8203;8676](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8676))
- chore: cleanup `IndentationTypeFixerTest`
([#&#8203;8675](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8675))
- chore: cleanup `ListSyntaxFixerTest`
([#&#8203;8674](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8674))
- chore: cleanup `MethodArgumentSpaceFixerTest`
([#&#8203;8673](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8673))
- chore: cleanup `MultilineWhitespaceBeforeSemicolonsFixerTest`
([#&#8203;8614](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8614))
- chore: cleanup `NativeConstantInvocationFixerTest`
([#&#8203;8672](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8672))
- chore: cleanup `NewWithParenthesesFixerTest`
([#&#8203;8592](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8592))
- chore: cleanup `NoBlankLinesAfterPhpdocFixerTest`
([#&#8203;8671](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8671))
- chore: cleanup `NoBreakCommentFixerTest`
([#&#8203;8670](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8670))
- chore: cleanup `NoClosingTagFixerTest`
([#&#8203;8669](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8669))
- chore: cleanup `NoEmptyStatementFixerTest`
([#&#8203;8667](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8667))
- chore: cleanup `NoSpacesAroundOffsetFixerTest`
([#&#8203;8666](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8666))
- chore: cleanup `NoUnneededControlParenthesesFixerTest`
([#&#8203;8665](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8665))
- chore: cleanup `NoUselessElseFixerTest`
([#&#8203;8664](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8664))
- chore: cleanup `PhpdocAddMissingParamAnnotationFixerTest`
([#&#8203;8663](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8663))
- chore: cleanup `PhpdocNoEmptyReturnFixerTest`
([#&#8203;8662](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8662))
- chore: cleanup `PhpdocNoPackageFixerTest`
([#&#8203;8626](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8626))
- chore: cleanup `PhpdocOrderByValueFixerTest`
([#&#8203;8661](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8661))
- chore: cleanup `PhpdocOrderFixerTest`
([#&#8203;8660](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8660))
- chore: cleanup `PhpdocParamOrderFixerTest`
([#&#8203;8659](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8659))
- chore: cleanup `PhpdocReturnSelfReferenceFixerTest`
([#&#8203;8658](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8658))
- chore: cleanup `PhpdocSeparationFixerTest`
([#&#8203;8657](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8657))
- chore: cleanup `PhpdocSummaryFixerTest`
([#&#8203;8654](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8654))
- chore: cleanup `PhpdocTrimFixerTest`
([#&#8203;8653](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8653))
- chore: cleanup `PhpdocTypesOrderFixerTest`
([#&#8203;8652](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8652))
- chore: cleanup `PhpdocVarWithoutNameFixerTest`
([#&#8203;8617](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8617))
- chore: cleanup `PhpUnitConstructFixerTest`
([#&#8203;8651](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8651))
- chore: cleanup `PhpUnitDedicateAssertFixerTest`
([#&#8203;8650](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8650))
- chore: cleanup `PhpUnitTestCaseStaticMethodCallsFixerTest`
([#&#8203;8649](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8649))
- chore: cleanup `Preg` issues
([#&#8203;8720](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8720))
- chore: cleanup `ReturnAssignmentFixerTest`
([#&#8203;8648](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8648))
- chore: cleanup `ReturnTypeDeclarationFixerTest`
([#&#8203;8647](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8647))
- chore: cleanup `SingleImportPerStatementFixerTest`
([#&#8203;8645](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8645))
- chore: cleanup `SingleLineCommentStyleFixerTest`
([#&#8203;8644](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8644))
- chore: cleanup `SingleSpaceAroundConstructFixerTest`
([#&#8203;8642](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8642))
- chore: cleanup `SpaceAfterSemicolonFixerTest`
([#&#8203;8625](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8625))
- chore: cleanup `SpacesInsideParenthesesFixerTest`
([#&#8203;8641](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8641))
- chore: cleanup `StatementIndentationFixerTest`
([#&#8203;8640](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8640))
- chore: cleanup `YodaStyleFixerTest`
([#&#8203;8638](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8638))
- chore: do not check if `JSON_INVALID_UTF8_IGNORE` is defined because
it always is (since PHP 7.2)
([#&#8203;8709](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8709))
- chore: handle saveXML failures explicitly
([#&#8203;8755](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8755))
- chore: ignore remaining PHPStan (false positive) issues
([#&#8203;8746](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8746))
- chore: improve PHPDoc's types in
([#&#8203;8741](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8741))
- chore: improve PHPDocs in tests
([#&#8203;8736](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8736))
- chore: improve PHPDocs in tests
([#&#8203;8744](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8744))
- chore: improve type of `Token::equalsAny`
([#&#8203;8743](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8743))
- chore: lint yaml files
([#&#8203;8622](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8622))
- chore: MultilinePromotedPropertiesFixer - mark new fixer introduced in
[#&#8203;8595](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8595)
as experimental
([#&#8203;8758](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8758))
- chore: PHPMD - cleanup `UnusedLocalVariable` for `foreach`
([#&#8203;8637](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8637))
- chore: refactor FCT
([#&#8203;8714](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8714))
- chore: remove unused local variables in src
([#&#8203;8600](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8600))
- chore: remove unused local variables in tests
([#&#8203;8599](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8599))
- chore: remove useless test from `AliasedFixerOptionTest`
([#&#8203;8739](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8739))
- chore: remove `defined` calls from tests
([#&#8203;8708](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8708))
- chore: restore original type of Token::equalsAny, partially reverts
[#&#8203;8743](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8743)
([#&#8203;8759](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8759))
- chore: run mutation tests on PHP 8.4
([#&#8203;8594](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8594))
- chore: solve one of phpstan warnings
([#&#8203;8754](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8754))
- chore: update dev tools
([#&#8203;8737](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8737))
- chore: update PHPUnit config
([#&#8203;8721](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8721))
- chore: update `checkbashisms` to 2.25.12
([#&#8203;8694](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8694))
- chore: update `checkbashisms` to 2.25.14
([#&#8203;8731](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8731))
- chore: use PHPStan type in data providers
([#&#8203;8605](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8605))
- chore: use `foreach` values
([#&#8203;8636](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8636))
- chore: use `Preg` class everywhere
([#&#8203;8689](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8689))
- CI: add self-approved label
([#&#8203;8757](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8757))
- CI: run on PHP 8.5
([#&#8203;8713](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8713))
- deps: bump alpine from 3.21.3 to 3.22.0
([#&#8203;8724](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8724))
- deps: bump alpine from 3.21.3 to 3.22.0
([#&#8203;8726](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8726))
- deps: bump ergebnis/composer-normalize from 2.45.0 to 2.46.0 in
/dev-tools
([#&#8203;8578](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8578))
- deps: bump ergebnis/composer-normalize from 2.46.0 to 2.47.0 in
/dev-tools
([#&#8203;8584](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8584))
- deps: bump phpstan/phpstan from 2.1.11 to 2.1.12 in /dev-tools in the
phpstan group
([#&#8203;8583](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8583))
- deps: bump phpstan/phpstan-symfony from 2.0.3 to 2.0.4 in /dev-tools
in the phpstan group
([#&#8203;8557](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8557))
- deps: bump the phpstan group across 1 directory with 2 updates
([#&#8203;8682](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8682))
- deps: upgrade docker deps
([#&#8203;8566](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8566))
- docs: extend and fix links to code
([#&#8203;8639](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8639))
- docs: Update SECURITY.md
([#&#8203;8716](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8716))
- docs: VisibilityRequiredFixer - extend docs
([#&#8203;8561](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8561))
- docs: `VisibilityRequiredFixer` - update docs
([#&#8203;8563](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8563))
- DX: add `symfony/polyfill-php84`
([#&#8203;8555](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8555))
- DX: always use the latest stable `checkbashisms` package
([#&#8203;8732](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8732))
- DX: check for `preg_` functions in tests
([#&#8203;8571](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8571))
- DX: cleanup `BlankLinesBeforeNamespaceFixerTest`
([#&#8203;8573](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8573))
- DX: cleanup `NativeFunctionInvocationFixerTest`
([#&#8203;8567](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8567))
- DX: cleanup `NoUselessConcatOperatorFixerTest`
([#&#8203;8572](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8572))
- DX: cleanup `SemicolonAfterInstructionFixerTest`
([#&#8203;8570](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8570))
- DX: fix data providers
([#&#8203;8693](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8693))
- DX: introduce `FCT` class for tokens not present in the lowest
supported PHP version
([#&#8203;8706](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8706))
- DX: move `symfony/polyfill-php84` to dev deps
([#&#8203;8559](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8559))
- DX: support PHP 8.4 in local Docker development environment
([#&#8203;8564](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8564))
- DX: trim array/yield keys
([#&#8203;8460](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8460))
- DX: use `WhitespacesAwareFixerInterface` only when needed
([#&#8203;8541](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8541))
- feat: add `NewExpressionParenthesesFixer`
([#&#8203;8246](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8246))
- feat: allowUnsupportedPhpVersion
([#&#8203;8733](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8733))
- feat: introduce `MultilinePromotedPropertiesFixer`
([#&#8203;8595](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8595))
- feat: Introduce `StaticPrivateMethodFixer`
([#&#8203;4557](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/4557))
- feat: `BracesPositionFixer` - support property hooks in promoted
properties
([#&#8203;8613](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8613))
- feat: `ClassAttributesSeparationFixer` - add support for property
hooks
([#&#8203;8610](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8610))
- feat: `GlobalNamespaceImportFixer` - analyze and fix more annotations
with types
([#&#8203;8593](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8593))
- feat: `LowercaseKeywordsFixer` - support asymmetric visibility
([#&#8203;8607](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8607))
- feat: `NoExtraBlankLinesFixer` - add comma to supported tokens
([#&#8203;8655](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8655))
- feat: `NoSuperfluousPhpdocTagsFixer` - support asymmetric visibility
([#&#8203;8700](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8700))
- feat: `NullableTypeDeclarationFixer` - support asymmetric visibility
([#&#8203;8697](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8697))
- feat: `OrderedClassElementsFixer` - add support for property hooks for
abstract properties
([#&#8203;8574](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8574))
- feat: `OrderedTypesFixer` - add support for asymmetric visibility
([#&#8203;8552](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8552))
- feat: `OrderedTypesFixer` - support asymmetric visibility in promoted
property
([#&#8203;8602](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8602))
- feat: `PhpdocAddMissingParamAnnotationFixer` - support asymmetric
visibility
([#&#8203;8701](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8701))
- feat: `PhpdocLineSpanFixer` - support asymmetric visibility
([#&#8203;8702](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8702))
- feat: `PhpdocVarWithoutNameFixer` - support asymmetric visibility
([#&#8203;8704](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8704))
- feat: `ProtectedToPrivateFixer` - add support for asymmetric
visibility
([#&#8203;8569](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8569))
- feat: `SingleClassElementPerStatementFixer` - support asymmetric
visibility
([#&#8203;8696](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8696))
- feat: `SingleSpaceAroundConstructFixer` - add support for asymmetric
visibility
([#&#8203;8699](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8699))
- feat: `StaticLambdaFixer` - support functions having classy elements
with `$this`
([#&#8203;8728](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8728))
- feat: `VisibilityRequiredFixer` - support ordering set-visibility
modifier
([#&#8203;8606](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8606))
- fix(dependabot): convert time values to string types
([#&#8203;8634](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8634))
- fix: "array" type must have no prefix to be fixable to "list"
([#&#8203;8692](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8692))
- fix: "min"/"max" in int generics must never be prefixed by backslash
([#&#8203;8691](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8691))
- fix: Allow non-doc comment on opening inline brace line
([#&#8203;8690](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8690))
- fix: `ConstantCaseFixer` - do not touch namespaces starting with
`Null\`
([#&#8203;8752](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8752))
- fix: `LowercaseStaticReferenceFixer` - do not change global constants
([#&#8203;8727](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8727))
- fix: `MultilineWhitespaceBeforeSemicolonsFixer` - do not touch
multiline constants definitions
([#&#8203;8615](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8615))
- fix: `NewWithParenthesesFixer` - fix `new` without parentheses on PHP
8.4 syntax
([#&#8203;8588](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8588))
- fix: `NoMultipleStatementsPerLineFixer` - handle `set` and `get` in
different casing in property hooks
([#&#8203;8558](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8558))
- fix: `NoUnusedImportsFixer` - handle imported class name with
underscore before or after it in PHPDoc
([#&#8203;8598](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8598))
- fix: `PhpUnitDedicateAssertFixer` - fix for `assertFalse` with
`instanceof`
([#&#8203;8597](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8597))
- fix: `PhpUnitNamespacedFixer` must rune before
`NoUnneededImportAliasFixer`
([#&#8203;8579](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8579))
- fix: `PhpUnitTestClassRequiresCoversFixer` - do not add
`@coversNothing` annotation when `CoversTrait` attribute is used
([#&#8203;8734](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8734))
- fix: `VisibilityRequiredFixer` - add support for asymmetric visibility
([#&#8203;8586](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8586))
- refactor: avoid unused local variables in tests
([#&#8203;8609](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8609))
- test: add more cases to `PhpUnitMethodCasingFixerTest`
([#&#8203;8551](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8551))
- test: fix "unused local variables `$token`"
([#&#8203;8603](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8603))
- test: More verbose error output for integration test
([#&#8203;8565](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8565))
- Update SECURITY.md

###
[`v3.75.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3750)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.74.0...v3.75.0)

- feat: `ClassAttributesSeparationFixer` - add support for asymmetric
visibility
([#&#8203;8518](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8518))
- fix: `NativeFunctionInvocationFixer` - fix for property hooks
([#&#8203;8540](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8540))
- chore: add return types for data providers for fixers
([#&#8203;8542](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8542))
- chore: add return types for data providers for non-fixers
([#&#8203;8543](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8543))
- chore: add return types for remaining data providers
([#&#8203;8544](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8544))
- chore: make data providers key type `int` if all the keys are strings
([#&#8203;8550](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8550))
- chore: make data providers key type `string` if all the keys are
strings
([#&#8203;8545](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8545))
- chore: SwitchContinueToBreakFixerTest - improve test case
descriptions/typehint
([#&#8203;8546](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8546))
- chore: `FunctionsAnalyzerTest` cleanup
([#&#8203;8539](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8539))
- deps: bump the phpstan group in /dev-tools with 2 updates
([#&#8203;8537](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8537))
- test: ProjectCodeTest::testDataProvidersDeclaredReturnType - allow for
int as iterable keys
([#&#8203;8548](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8548))

###
[`v3.74.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3740)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.73.1...v3.74.0)

- feat: add `--format=@&#8203;auto`
([#&#8203;8513](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8513))
- fix: `BracesPositionFixer` - do not create two consecutive whitespace
tokens
([#&#8203;8496](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8496))
- fix: `MbStrFunctionsFixer` - fix imports with leading backslash
([#&#8203;8507](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8507))
- fix: `NoUnreachableDefaultArgumentValueFixer` - do not crash on
property hook
([#&#8203;8512](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8512))
- fix: `OrderedImportsFixer` - do not take the braces part in grouped
imports into account
([#&#8203;8459](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8459))
- fix: `OrderedImportsFixer` - fix syntax error with grouped use
statement and multiple use with comma
([#&#8203;8483](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8483))
- fix: `PhpUnitAttributesFixer` - handle parentheses after data provider
method name
([#&#8203;8510](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8510))
- fix: `PhpUnitMethodCasingFixer` - do not touch anonymous class
([#&#8203;8463](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8463))
- chore: make options that have default and allowed sets the same size
the same array
([#&#8203;8529](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8529))
- chore: update return type of `FixerOptionInterface::getAllowedValues`
([#&#8203;8530](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8530))
- chore: `Preg` - improve types
([#&#8203;8527](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8527))
- CI: fix code coverage job
([#&#8203;8520](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8520))
- CI: try MacOS job without ParaUnit
([#&#8203;8528](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8528))
- deps: update PHPStan
([#&#8203;8531](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8531))
- deps: upgrade `PHPStan/*`
([#&#8203;8524](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8524))

###
[`v3.73.1`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3731)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.73.0...v3.73.1)

- fix: `OrderedClassElementsFixer` - do not crash on property hook
([#&#8203;8517](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8517))

###
[`v3.73.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3730)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.72.0...v3.73.0)

- feat: add support for asymmetric visibility to Doctrine's fixers
([#&#8203;8415](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8415))
- fix: `GeneralPhpdocTagRenameFixer` - do not rename keys in array shape
definition
([#&#8203;8477](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8477))
- fix: `MethodArgumentSpaceFixer` - handle when nested in HTML
([#&#8203;8503](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8503))
- chore: update `checkbashisms` to 2.25.5
([#&#8203;8519](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8519))
- DX: cleanup `NoExtraBlankLinesFixerTest`
([#&#8203;8505](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8505))
- DX: for duplicated test methods check methods without parameters
([#&#8203;8508](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8508))
- DX: remove more duplicated test methods
([#&#8203;8506](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8506))
- refactor: `Tokenizer` hash metode using `xxHash`
([#&#8203;8491](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8491))
- refactor: `TokensAnalyzerTest` - better test `isArray` and
`isArrayMultiLine`
([#&#8203;8504](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8504))
- test: run code coverage on PHP 8.4
([#&#8203;8448](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8448))

###
[`v3.72.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3720)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.71.0...v3.72.0)

- feat: `StatementIndentationFixer` - handle property hooks
([#&#8203;8492](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8492))
- fix: `MbStrFunctionsFixer` - fix imports
([#&#8203;8474](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8474))
- fix: `TrailingCommaInMultilineFixer` - handle empty match body
([#&#8203;8480](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8480))
- fix: `VisibilityRequiredFixer` - handle property hooks
([#&#8203;8495](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8495))
- deps: upgrade few dev-deps
([#&#8203;8490](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8490))
- deps: Upgrade PHPStan to 2.1.8
([#&#8203;8489](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8489))
- DX: add trailing comma to multiline auto-generated types
([#&#8203;8499](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8499))
- refactor: generalize CodeHasher into Hasher
([#&#8203;8500](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8500))
- refactor: Runner - unify paths used when using parallel runner
([#&#8203;8488](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8488))
- refactor: use Hasher instead of md5 directly
([#&#8203;8501](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8501))

###
[`v3.71.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3710)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.70.2...v3.71.0)

- feat: OrderedImportsFixer - deprecate length sorting algorithm
([#&#8203;8473](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8473))
- fix: `BinaryOperatorSpacesFixer` - do not break alignment of UTF-8
array keys
([#&#8203;8484](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8484))
- fix: `PhpdocAlignFixer` - align correctly type with UTF8 characters
([#&#8203;8486](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8486))
- fix: `SingleSpaceAroundConstructFixer` - handle alternative syntax
([#&#8203;8317](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8317))
- fix: `StatementIndentationFixer` - return in braceless if
([#&#8203;8479](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8479))
- chore: update type in
`SingleSpaceAroundConstructFixerTest::provideFixWithElseIfCases`
([#&#8203;8481](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8481))
- chore: update type in
`SingleSpaceAroundConstructFixerTest::provideFixWithIfCases`
([#&#8203;8482](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8482))
- deps: bump phpstan/phpstan from 2.1.6 to 2.1.7 in /dev-tools in the
phpstan group
([#&#8203;8485](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8485))
- DX: cleanup `PhpdocNoAliasTagFixerTest`
([#&#8203;8476](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8476))
- refactor: add `FullyQualifiedNameAnalyzer`
([#&#8203;8048](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8048))
- refactor: codeHash - update when it's (re-)generated
([#&#8203;8470](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8470))
- refactor: `SwitchAnalyzer` - improve performance
([#&#8203;8407](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8407))
- test: NameQualifiedTransformerTest - correct test case
([#&#8203;8471](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8471))

###
[`v3.70.2`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3702)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.70.1...v3.70.2)

- deps: upgrade deep dev-tools deps
([#&#8203;8472](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8472))
- fix: `MbStrFunctionsFixer` must run before
`NativeFunctionInvocationFixer`
([#&#8203;8466](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8466))
- fix: `MethodArgumentSpaceFixer` - fix nested calls for
`ensure_fully_multiline` option
([#&#8203;8469](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8469))

###
[`v3.70.1`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3701)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.70.0...v3.70.1)

- fix: `PhpUnitSizeClassFixer` must run before `PhpUnitAttributesFixer`
([#&#8203;8457](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8457))
- DX: cleanup `OrderedImportsFixerTest`
([#&#8203;8458](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8458))

###
[`v3.70.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3700)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.69.1...v3.70.0)

- feat: Add `PhpUnitDataProviderMethodOrderFixer` fixer
([#&#8203;8225](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8225))
- feat: `HeaderCommentFixer` - allow validators
([#&#8203;8452](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8452))
- feat: `PhpCsFixer` ruleset: use `operator_linebreak` rule for all
operators
([#&#8203;8417](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8417))
- feat: `PhpUnitMethodCasingFixer` to support PHPUnit's `Test` attribute
([#&#8203;8451](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8451))
- feat: `TypeDeclarationSpacesFixer` - Fix whitespace between const type
and const name
([#&#8203;8442](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8442))
- chore: extend bug report template
([#&#8203;8447](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8447))
- chore: extend bug report template - more installation options
([#&#8203;8450](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8450))
- CI: phpstan-symfony - add entry point for console
([#&#8203;8292](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8292))
- deps: bump alpine from 3.21.2 to 3.21.3
([#&#8203;8454](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8454))
- deps: bump phpstan/phpstan from 2.1.5 to 2.1.6 in /dev-tools in the
phpstan group
([#&#8203;8453](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8453))
- fix: `CommentsAnalyzer` - allow other forms of assignment as valid
structural elements for PHPDocs
([#&#8203;8371](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8371))
- fix: `PhpUnitTestClassRequiresCoversFixer` must run before
`PhpUnitAttributesFixer`
([#&#8203;8444](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8444))
- test: fix `CheckCommandTest::testDryRunModeIsUnavailable` to correctly
check that option `--dry-run` is unavailable
([#&#8203;8438](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8438))

###
[`v3.69.1`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3691)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.69.0...v3.69.1)

- fix: `PhpUnitAttributesFixer` - convert correctly version constraint
([#&#8203;8439](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8439))
- test: `PhpUnitAttributesFixer` must run before `NoEmptyPhpdocFixer`
([#&#8203;8443](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8443))

###
[`v3.69.0`](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/HEAD/CHANGELOG.md#Changelog-for-v3690)

[Compare
Source](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.68.5...v3.69.0)

- feat: Add unsealed array shape phpdoc support
([#&#8203;8299](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8299))
- fix: `OrderedClassElementsFixer` - sort correctly typed constants
([#&#8203;8408](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8408))
- chore: do not use test class as test data
([#&#8203;8430](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8430))
- chore: update `checkbashisms` to 2.25.2
([#&#8203;8427](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8427))
- chore: use constants instead of literal strings
([#&#8203;8422](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8422))
- CI: no need to unlock deps on master
([#&#8203;8426](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8426))
- CI: run tests using PHPUnit 12
([#&#8203;8431](https://redirect.github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/8431))
- deps: bump kubawerlos/composer-s

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/libretime/libretime).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS41MS4xIiwidXBkYXRlZEluVmVyIjoiNDEuNTEuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicGhwIl19-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
2025-08-09 15:57:06 +02:00

1962 lines
71 KiB
PHP

<?php
define('MAX_REBROADCAST_DATES', 10);
define('NO_REPEAT', -1);
define('REPEAT_WEEKLY', 0);
define('REPEAT_BI_WEEKLY', 1);
define('REPEAT_MONTHLY_MONTHLY', 2);
define('REPEAT_MONTHLY_WEEKLY', 3);
define('REPEAT_TRI_WEEKLY', 4);
define('REPEAT_QUAD_WEEKLY', 5);
class Application_Service_ShowService
{
private $ccShow;
private $isRecorded;
private $isRebroadcast;
private $repeatType;
private $isUpdate;
private $oldShowTimezone;
private $localShowStartHour;
private $localShowStartMin;
private $origCcShowDay;
private $origShowRepeatStatus;
private $instanceIdsForScheduleUpdates;
// keeps track of which show instances are new from either adding a new show
// day or changing the repeat type day during a show edit, or when a user moves
// forward in the calendar
private $newInstanceIdsCreated;
public function __construct($showId = null, $showData = null, $isUpdate = false)
{
if (!is_null($showId)) {
$this->ccShow = CcShowQuery::create()->findPk($showId);
}
if (isset($showData['add_show_repeats']) && $showData['add_show_repeats']) {
$this->repeatType = $showData['add_show_repeat_type'];
if ($showData['add_show_repeat_type'] == 2) {
$this->repeatType = $showData['add_show_monthly_repeat_type'];
}
} else {
$this->repeatType = -1;
}
$this->isRecorded = (isset($showData['add_show_record']) && $showData['add_show_record']) ? 1 : 0;
$this->isRebroadcast = (isset($showData['add_show_rebroadcast']) && $showData['add_show_rebroadcast']) ? 1 : 0;
$this->isUpdate = $isUpdate;
$this->instanceIdsForScheduleUpdates = [];
$this->newInstanceIdsCreated = [];
}
public function editRepeatingShowInstance($showData)
{
$service_user = new Application_Service_UserService();
$currentUser = $service_user->getCurrentUser();
$showData['add_show_duration'] = $this->formatShowDuration(
$showData['add_show_duration']
);
$con = Propel::getConnection();
$con->beginTransaction();
try {
if (!$currentUser->isAdminOrPM()) {
throw new Exception('Permission denied');
}
$showId = $showData['add_show_id'];
// UPDATE SCHEDULE START TIME
// get the ccShow object to which this instance belongs
// so we can get the original start date and time
$this->ccShow = CcShowQuery::create()
->findPk($showId);
// DateTime in shows's local time
$newStartDateTime = new DateTime(
$showData['add_show_start_date']
. ' '
. $showData['add_show_start_time'],
new DateTimeZone($showData['add_show_timezone'])
);
$ccShowInstanceOrig = CcShowInstancesQuery::create()
->findPk($showData['add_show_instance_id']);
// convert original start time into the show's local timezone
$origLocalStartDateTime = $ccShowInstanceOrig->getLocalStartDateTime();
$diff = $this->calculateShowStartDiff(
$newStartDateTime,
$origLocalStartDateTime
);
if ($diff != 0) {
Application_Service_SchedulerService::updateScheduleStartTime(
[$showData['add_show_instance_id']],
$diff
);
}
// UPDATE SCHEDULE START TIME ENDS
/*
* In the case where an instance is being edited for a second
* (or third, fourth, etc.) time we need to delete the old
* cc_show_day record
*
* Since we don't store the cc_show_day ids we need to use the
* original start time from cc_show_instances, convert it to the show's
* local timezone, and find the record in cc_show_days
*
* *** There is a flaw here: We have to assume the show timezone has
* *** not changed (make timezone readonly??)
*/
$origCcShowDay = CcShowDaysQuery::create()
->filterByDbShowId($showId)
->filterByDbRepeatType(-1)
->filterByDbFirstShow($origLocalStartDateTime->format('Y-m-d'))
->filterByDbStartTime($origLocalStartDateTime->format('H:i:s'))
->delete();
/*
* Set the new cc_show_day record
* Associates it with the current show_id and sets it to non-repeating
*/
$this->setCcShowDays($showData);
/*
* We need to find the new show day rule we just created by passing
* in the first show and start time in case multiple single
* instances have been edited out of the repeating sequence.
*/
$showDay = CcShowDaysQuery::create()
->filterByDbShowId($showId)
->filterByDbRepeatType(-1)
->filterByDbFirstShow($showData['add_show_start_date'])
->filterByDbStartTime($showData['add_show_start_time'] . ':00')
->findOne();
$ccShowInstance = $this->createNonRepeatingInstance(
$showDay,
$this->getPopulateShowUntilDateTIme()
);
// update cc_schedule with the new instance id
$con = Propel::getConnection(CcShowInstancesPeer::DATABASE_NAME);
$selectCriteria = new Criteria();
$selectCriteria->add(CcSchedulePeer::INSTANCE_ID, $showData['add_show_instance_id']);
$updateCriteria = new Criteria();
$updateCriteria->add(CcSchedulePeer::INSTANCE_ID, $ccShowInstance->getDbId());
BasePeer::doUpdate($selectCriteria, $updateCriteria, $con);
$ccShowInstance->updateDbTimeFilled($con);
$ccShowInstance->updateScheduleStatus($con);
$ccShowInstance
->setDbDescription($showData['add_show_instance_description'])
->save();
// delete the edited instance from the repeating sequence
$ccShowInstanceOrig
->setDbModifiedInstance(true)
->setDbDescription($showData['add_show_instance_description'])
->save();
$con->commit();
Application_Model_RabbitMq::PushSchedule();
} catch (Exception $e) {
$con->rollback();
Logging::info('EXCEPTION: Show update failed.');
Logging::info($e->getMessage());
}
}
/**
* If a user is editing a show we need to store the original timezone and
* start time in case the show's timezone is changed and we are crossing
* over DST.
*/
private function storeOrigLocalShowInfo()
{
if ($this->ccShow->isRepeating()) {
$this->origCcShowDay = clone $this->ccShow->getFirstRepeatingCcShowDay();
$this->origShowRepeatStatus = true;
} else {
$this->origCcShowDay = clone $this->ccShow->getFirstCcShowDay();
$this->origShowRepeatStatus = false;
}
$this->oldShowTimezone = $this->origCcShowDay->getDbTimezone();
$origStartTime = explode(':', $this->origCcShowDay->getDbStartTime());
$this->localShowStartHour = $origStartTime[0];
$this->localShowStartMin = $origStartTime[1];
}
public function addUpdateShow($showData)
{
$service_user = new Application_Service_UserService();
$currentUser = $service_user->getCurrentUser();
$showData['add_show_duration'] = $this->formatShowDuration(
$showData['add_show_duration']
);
$con = Propel::getConnection();
$con->beginTransaction();
try {
if (!$currentUser->isAdminOrPM()) {
throw new Exception('Permission denied');
}
// update ccShow
$this->setCcShow($showData);
$daysAdded = [];
if ($this->isUpdate) {
$showId = $this->ccShow->getDbId();
// Only delete the previous logo if a new one is being uploaded
if (array_key_exists('add_show_logo_name', $showData) && $showData['add_show_logo_name'] !== '') {
if (!Rest_ShowImageController::deleteShowImagesFromStor($showId)) {
throw new Exception('Error deleting show images');
}
}
if (!$this->ccShow->getCcShowDayss()->isEmpty()) {
$this->storeOrigLocalShowInfo();
}
$daysAdded = $this->delegateInstanceCleanup($showData);
$this->deleteRebroadcastInstances();
$this->deleteCcShowHosts();
if ($this->isRebroadcast) {
// delete entry in cc_show_rebroadcast
$this->deleteCcShowRebroadcasts();
}
$this->storeInstanceIds();
}
// update ccShowDays
$this->setCcShowDays($showData);
// update ccShowRebroadcasts
$this->setCcShowRebroadcasts($showData);
// update ccShowHosts
$this->setCcShowHosts($showData);
// create new ccShowInstances
$this->delegateInstanceCreation($daysAdded);
if ($this->isUpdate) {
/* If the show is repeating and the start date changes we need
* to ignore that difference when re-calculating schedule start times.
* Otherwise it might calculate a difference of a week, for example.
*/
if (
$this->ccShow->isRepeating()
&& $this->origCcShowDay->getLocalStartDateAndTime()->format('Y-m-d') != $showData['add_show_start_date']
) {
$showData['add_show_start_date'] = $this->origCcShowDay->getLocalStartDateAndTime()->format('Y-m-d');
}
$this->adjustSchedule($showData);
}
$con->commit();
Application_Model_RabbitMq::PushSchedule();
} catch (Exception $e) {
$con->rollback();
$this->isUpdate ? $action = 'update' : $action = 'creation';
Logging::info('EXCEPTION: Show ' . $action . ' failed.');
Logging::info($e->getMessage());
}
// Added to pass along to the RESTful ShowImageController
return $this->ccShow->getDbId();
}
/**
* Returns an array of instance ids that already exist
* We need this if a show is being updated so we can separate the
* instances that already exist and any new instances that
* get created (by adding a new repeat show day).
*/
private function storeInstanceIds()
{
$instances = $this->ccShow->getFutureCcShowInstancess();
foreach ($instances as $instance) {
$this->instanceIdsForScheduleUpdates[] = $instance->getDbId();
}
}
/**
* Adjusts the items in cc_schedule to reflect the
* new (if one) start and end time of the show getting updated.
*
* @param mixed $showData
*/
private function adjustSchedule($showData)
{
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
$this->updateScheduleStartEndTimes($showData);
$ccShowInstances = $this->ccShow->getFutureCcShowInstancess();
foreach ($ccShowInstances as $instance) {
$instance->updateScheduleStatus($con);
}
}
/**
* Receives a cc_show id and determines whether to create a
* single show instance or repeating show instances.
*
* @param null|mixed $daysAdded
* @param null|mixed $end
* @param mixed $fillInstances
*/
public function delegateInstanceCreation($daysAdded = null, $end = null, $fillInstances = false)
{
$populateUntil = $this->getPopulateShowUntilDateTIme();
if (is_null($this->ccShow)) {
$ccShowDays = $this->getShowDaysInRange($populateUntil, $end);
} else {
if ($this->ccShow->isRepeating()) {
$ccShowDays = $this->ccShow->getRepeatingCcShowDays();
} else {
// $ccShowDays = $this->ccShow->getCcShowDayss();
/* Cannot use the above statement to get the cc_show_days
* object because it's getting the old object before the
* show was edited. clearInstancePool() didn't work.
*/
$ccShowDays = CcShowDaysQuery::create()
->filterByDbShowId($this->ccShow->getDbId())
->find();
}
}
if (!is_null($end)) {
$populateUntil = $end;
}
/* In case the user is moving forward in the calendar and there are
* linked shows in the schedule we need to keep track of each cc_show
* so we know which shows need to be filled with content
*/
$ccShows = [];
foreach ($ccShowDays as $day) {
$this->ccShow = $day->getCcShow();
$this->isRecorded = $this->ccShow->isRecorded();
$this->isRebroadcast = $this->ccShow->isRebroadcast();
$show_id = $day->getDbShowId();
if (!isset($ccShows[$show_id])) {
$ccShows[$show_id] = $day->getccShow();
}
// keep track of the new show instances getting created
// so we can fill their schedule after
if (!isset($this->newInstanceIdsCreated[$show_id])) {
$this->newInstanceIdsCreated[$show_id] = [];
}
switch ($day->getDbRepeatType()) {
case NO_REPEAT:
$this->createNonRepeatingInstance($day, $populateUntil);
break;
case REPEAT_WEEKLY:
$this->createWeeklyRepeatInstances(
$day,
$populateUntil,
REPEAT_WEEKLY,
new DateInterval('P7D'),
$daysAdded
);
break;
case REPEAT_BI_WEEKLY:
$this->createWeeklyRepeatInstances(
$day,
$populateUntil,
REPEAT_BI_WEEKLY,
new DateInterval('P14D'),
$daysAdded
);
break;
case REPEAT_TRI_WEEKLY:
$this->createWeeklyRepeatInstances(
$day,
$populateUntil,
REPEAT_TRI_WEEKLY,
new DateInterval('P21D'),
$daysAdded
);
break;
case REPEAT_QUAD_WEEKLY:
$this->createWeeklyRepeatInstances(
$day,
$populateUntil,
REPEAT_QUAD_WEEKLY,
new DateInterval('P28D'),
$daysAdded
);
break;
case REPEAT_MONTHLY_MONTHLY:
$this->createMonthlyRepeatInstances($day, $populateUntil);
break;
case REPEAT_MONTHLY_WEEKLY:
$this->createMonthlyRepeatInstances($day, $populateUntil);
break;
}
}
foreach ($ccShows as $ccShow) {
if (($this->isUpdate || $fillInstances) && $ccShow->isLinked()) {
Application_Service_SchedulerService::fillLinkedInstances(
$ccShow,
$this->newInstanceIdsCreated[$ccShow->getDbId()]
);
}
}
/*if (isset($this->linkedShowContent)) {
Application_Service_SchedulerService::fillPreservedLinkedShowContent(
$this->ccShow, $this->linkedShowContent);
}*/
return $this->ccShow;
}
private function getShowDaysInRange($start, $end)
{
$endTimeString = $end->format(DEFAULT_TIMESTAMP_FORMAT);
if (!is_null($start)) {
$startTimeString = $start->format(DEFAULT_TIMESTAMP_FORMAT);
} else {
$today_timestamp = new DateTime('now', new DateTimeZone('UTC'));
$startTimeString = $today_timestamp->format(DEFAULT_TIMESTAMP_FORMAT);
}
$c = new Criteria();
$c->add(CcShowDaysPeer::FIRST_SHOW, $endTimeString, Criteria::LESS_THAN);
$c->addAnd(CcShowDaysPeer::LAST_SHOW, $startTimeString, Criteria::GREATER_THAN);
$c->addAnd(CcShowDaysPeer::REPEAT_TYPE, -1, Criteria::NOT_EQUAL);
$c->addOr(CcShowDaysPeer::LAST_SHOW, null, Criteria::ISNULL);
return CcShowDaysPeer::doSelect($c);
}
public static function formatShowDuration($duration)
{
$hPos = strpos($duration, 'h');
$mPos = strpos($duration, 'm');
$hValue = 0;
$mValue = 0;
if ($hPos !== false) {
$hValue = trim(substr($duration, 0, $hPos));
}
if ($mPos !== false) {
$hPos = $hPos === false ? 0 : $hPos + 1;
$mValue = trim(substr($duration, $hPos, -1));
}
return $hValue . ':' . $mValue;
}
/**
* Deletes all the cc_show_days entries for a specific show
* that is currently being edited. They will get recreated with
* the new show day specs.
*/
private function deleteCcShowDays()
{
CcShowDaysQuery::create()->filterByDbShowId($this->ccShow->getDbId())->delete();
}
private function deleteRebroadcastInstances()
{
$sql = <<<'SQL'
DELETE FROM cc_show_instances
WHERE starts > :timestamp::TIMESTAMP
AND show_id = :showId
AND rebroadcast = 1;
SQL;
Application_Common_Database::prepareAndExecute($sql, [
':showId' => $this->ccShow->getDbId(),
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
], 'execute');
}
private function deleteAllShowDays($showId)
{
CcShowDaysQuery::create()
->filterByDbShowId($showId)
->delete();
}
/**
* TODO: This function is messy. Needs refactoring.
*
* When editing a show we may need to perform some actions to reflect the new specs:
* - Delete some show instances
* - Update duration
* - Update start and end time
*
* @param $showData edit show form values in raw form
*/
private function delegateInstanceCleanup($showData)
{
$showId = $this->ccShow->getDbId();
$daysAdded = [];
// CcShowDay object
if ($this->ccShow->isRepeating()) {
$currentShowDay = $this->ccShow->getFirstRepeatingCcShowDay();
// all cc_show_days
$ccShowDays = $this->ccShow->getRepeatingCcShowDays();
} else {
$currentShowDay = $this->ccShow->getFirstCcShowDay();
// all cc_show_days
$ccShowDays = $this->ccShow->getCcShowDayss();
}
// new end date in the show's timezone (from the select box)
$endDateTime = $this->calculateEndDate($showData);
// repeat option was toggled
if ($showData['add_show_repeats'] != $currentShowDay->isRepeating()) {
$this->deleteAllRepeatInstances($currentShowDay, $showId);
if (!$showData['add_show_repeats']) {
$this->deleteAllShowDays($showId);
}
// if repeat option was checked we need to treat the current show day
// as a new show day so the repeat instances get created properly
// in createWeeklyRepeatInstances()
if ($showData['add_show_repeats']) {
array_push($daysAdded, $currentShowDay->getDbDay());
}
}
if ($showData['add_show_repeats']) {
$localShowStart = $currentShowDay->getLocalStartDateAndTime();
// if the start date changes, these are the repeat types
// that require show instance deletion
$deleteRepeatTypes = [
REPEAT_BI_WEEKLY, REPEAT_TRI_WEEKLY, REPEAT_QUAD_WEEKLY, REPEAT_MONTHLY_MONTHLY,
REPEAT_MONTHLY_WEEKLY,
];
if (
in_array($this->repeatType, $deleteRepeatTypes)
&& $showData['add_show_start_date'] != $localShowStart->format('Y-m-d')
) {
// Start date has changed when repeat type is bi-weekly or monthly.
// This screws up the repeating positions of show instances, so
// we need to delete them (CC-2351)
$this->deleteAllInstances($showId);
}
$currentRepeatType = $currentShowDay->getDbRepeatType();
// only delete instances if the show being edited was already repeating
// and the repeat type changed
if ($currentRepeatType != -1 && $this->repeatType != $currentRepeatType) {
$this->deleteAllInstances($showId);
$this->deleteAllShowDays($showId);
// when repeating by day of the month (1st, 2nd, etc.) we do not store the repeat week days
} elseif ($currentRepeatType != 2) {
// repeat type is the same, check if the days of the week are the same
$repeatingDaysChanged = false;
$showDays = [];
foreach ($ccShowDays as $day) {
$showDays[] = $day->getDbDay();
}
if (count($showData['add_show_day_check']) == count($showDays)) {
// same number of days checked, lets see if they are the same numbers
$intersect = array_intersect($showData['add_show_day_check'], $showDays);
if (count($intersect) != count($showData['add_show_day_check'])) {
$repeatingDaysChanged = true;
}
} else {
$repeatingDaysChanged = true;
}
if ($repeatingDaysChanged) {
$daysRemoved = array_diff($showDays, $showData['add_show_day_check']);
$newDays = array_diff($showData['add_show_day_check'], $showDays);
foreach ($newDays as $newDay) {
array_push($daysAdded, $newDay);
}
if (count($daysRemoved) > 0) {
// delete repeating show instances for the repeating
// days that were removed
/*if ($this->ccShow->isLinked()) {
$this->preserveLinkedShowContent();
}*/
$this->deleteRemovedShowDayInstances(
$daysRemoved,
$ccShowDays,
$showId
);
}
}
if (
$showData['add_show_start_date'] != $localShowStart->format('Y-m-d')
|| $showData['add_show_start_time'] != $localShowStart->format('H:i')
) {
// start date has been pushed forward so we need to delete
// any instances of this show scheduled before the new start date
if ($showData['add_show_start_date'] > $localShowStart->format('Y-m-d')) {
$this->deleteInstancesBeforeDate($showData['add_show_start_date'], $showId);
}
}
}
// get the endate from the past for this show.
// check if this is null if "no end"
$currentShowEndDateTime = $this->getRepeatingEndDate();
if ($endDateTime && $currentShowEndDateTime != $endDateTime) {
$endDate = clone $endDateTime;
$endDate->setTimezone(new DateTimeZone('UTC'));
// show's "No End" option was toggled
// or the end date comes earlier
if (is_null($currentShowEndDateTime) || ($endDateTime < $currentShowEndDateTime)) {
// "No End" option was unchecked so we need to delete the
// repeat instances that are scheduled after the new end date
// OR
// end date was pushed back so we have to delete any
// instances of this show scheduled after the new end date
$this->deleteInstancesFromDate($endDate->format('Y-m-d'), $showId);
}
}
}
return $daysAdded;
}
/*private function preserveLinkedShowContent()
{
// Get show content from any future linked instance. It doesn't
// matter which instance since content is the same in all.
//
$ccShowInstance = $this->ccShow->getFutureCcShowInstancess()->getFirst();
if (!$ccShowInstance) {
return;
}
$ccSchedules = CcScheduleQuery::create()
->filterByDbInstanceId($ccShowInstance->getDbId())
->find();
if (!$ccSchedules->isEmpty()) {
$this->linkedShowContent = $ccSchedules;
}
}*/
// returns a DateTime of the current show end date set to the timezone of the show.
public function getRepeatingEndDate()
{
$sql = <<<'SQL'
SELECT last_show, timezone
FROM cc_show_days
WHERE show_id = :showId
ORDER BY last_show DESC
LIMIT 1
SQL;
$query = Application_Common_Database::prepareAndExecute(
$sql,
['showId' => $this->ccShow->getDbId()],
'single'
);
$date = null;
if ($query !== false && isset($query['last_show'])) {
$date = new DateTime(
$query['last_show'],
new DateTimeZone($query['timezone'])
);
}
return $date;
}
private function deleteInstancesFromDate($endDate, $showId)
{
$sql = <<<'SQL'
DELETE FROM cc_show_instances
WHERE date(starts) >= :endDate::DATE
AND starts > :timestamp::TIMESTAMP
AND show_id = :showId
SQL;
Application_Common_Database::prepareAndExecute($sql, [
':endDate' => $endDate, ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
':showId' => $showId,
], 'execute');
}
private function deleteInstancesBeforeDate($newStartDate, $showId)
{
$sql = <<<'SQL'
DELETE
FROM cc_show_instances
WHERE date(starts) < :newStartDate::DATE
AND starts > :timestamp::TIMESTAMP
AND show_id = :showId
SQL;
Application_Common_Database::prepareAndExecute($sql, [
':newStartDate' => $newStartDate, ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
':showId' => $showId,
], 'execute');
}
/**
* Enter description here ...
*
* @param $daysRemoved array of days (days of the week) removed
* (days of the week are represented numerically
* 0=>sunday, 1=>monday, 2=>tuesday, etc.)
* @param $showDays array of ccShowDays objects
* @param mixed $showId
*/
private function deleteRemovedShowDayInstances($daysRemoved, $showDays, $showId)
{
$daysRemovedUTC = [];
// convert the start day of the week to UTC
foreach ($showDays as $showDay) {
if (in_array($showDay->getDbDay(), $daysRemoved)) {
$showDay->reload();
$startDay = $showDay->getUTCStartDateAndTime();
$daysRemovedUTC[] = $startDay->format('w');
}
}
foreach ($daysRemoved as $day) {
// delete the cc_show_day entries as well
CcShowDaysQuery::create()
->filterByDbShowId($showId)
->filterByDbDay($day)
->delete();
}
$uncheckedDays = pg_escape_string(implode(',', $daysRemovedUTC));
$sql = <<<SQL
DELETE
FROM cc_show_instances
WHERE EXTRACT(DOW FROM starts) IN ({$uncheckedDays})
AND starts > :timestamp::TIMESTAMP
AND show_id = :showId
SQL;
Application_Common_Database::prepareAndExecute(
$sql,
[
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT), ':showId' => $showId,
],
'execute'
);
}
public function deleteShow($instanceId, $singleInstance = false)
{
$service_user = new Application_Service_UserService();
$currentUser = $service_user->getCurrentUser();
$con = Propel::getConnection();
$con->beginTransaction();
try {
if (!$currentUser->isAdminOrPM()) {
throw new Exception('Permission denied');
}
$ccShowInstance = CcShowInstancesQuery::create()
->findPk($instanceId);
if (!$ccShowInstance) {
throw new Exception('Could not find show instance');
}
// Delete show images
$showId = $ccShowInstance->getDbShowId();
if (!$singleInstance && !Rest_ShowImageController::deleteShowImagesFromStor($showId)) {
throw new Exception('Error deleting show images');
}
if ($singleInstance) {
$ccShowInstances = [$ccShowInstance];
} else {
$ccShowInstances = CcShowInstancesQuery::create()
->filterByDbShowId($showId)
->filterByDbStarts($ccShowInstance->getDbStarts(), Criteria::GREATER_EQUAL)
->find();
}
if (gmdate(DEFAULT_TIMESTAMP_FORMAT) <= $ccShowInstance->getDbEnds()) {
$this->deleteShowInstances($ccShowInstances, $showId);
} else {
throw new Exception('Cannot delete a show instance in the past');
}
Application_Model_StoredFile::updatePastFilesIsScheduled();
Application_Model_RabbitMq::PushSchedule();
$con->commit();
return $showId;
} catch (Exception $e) {
$con->rollback();
Logging::info('Delete show instance failed');
Logging::info($e->getMessage());
return false;
}
}
public function deleteShowInstances($ccShowInstances, $showId)
{
foreach ($ccShowInstances as $ccShowInstance) {
$instanceId = $ccShowInstance->getDbId();
$ccShowInstance
->setDbModifiedInstance(true)
->save();
// delete the rebroadcasts of the removed recorded show
if ($ccShowInstance->isRecorded()) {
CcShowInstancesQuery::create()
->filterByDbOriginalShow($instanceId)
->delete();
}
// delete all files scheduled in cc_schedules table
CcScheduleQuery::create()
->filterByDbInstanceId($instanceId)
->delete();
}
if ($this->checkToDeleteCcShow($showId)) {
CcShowQuery::create()
->filterByDbId($showId)
->delete();
// There is only one cc_show_instance if the user selects 'Delete This Instance'
// There is more than one cc_show_instance if the user selects 'Delete This
// Instance and All Following'. We only need to set the last_show value
// when 'Delete This Instance and All Following' has been selected
} elseif (count($ccShowInstances) > 1) {
$this->setLastRepeatingShowDate($showId);
}
}
private function setLastRepeatingShowDate($showId)
{
$ccShowInstances = CcShowInstancesQuery::create()
->filterByDbShowId($showId)
->filterByDbModifiedInstance(false)
->filterByDbRebroadcast(0)
->orderByDbStarts()
->find();
/* We need to update the last_show in cc_show_days so the instances
* don't get recreated as the user moves forward in the calendar
*/
$lastShowDays = [];
// get the show's timezone
$ccShow = CcShowQuery::create()->findPk($showId);
if ($ccShow->isRepeating()) {
$showTimezone = $ccShow->getFirstRepeatingCcShowDay()->getDbTimezone();
} else {
$showTimezone = $ccShow->getFirstCcShowDay()->getDbTimezone();
}
/* Creates an array where the key is the day of the week (monday,
* tuesday, etc.) and the value is the last show date for each
* day of the week. We will use this array to update the last_show
* for each cc_show_days entry of a cc_show
*/
foreach ($ccShowInstances as $instance) {
$instanceStartDT = $instance->getDbStarts(null);
$instanceStartDT->setTimezone(new DateTimeZone($showTimezone));
$lastShowDays[$instanceStartDT->format('w')] = $instanceStartDT;
}
foreach ($lastShowDays as $dayOfWeek => $lastShowStartDT) {
$ccShowDay = CcShowDaysQuery::create()
->filterByDbShowId($showId)
->filterByDbDay($dayOfWeek)
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
->findOne();
if (isset($ccShowDay)) {
$lastShowStartDT->setTimeZone(new DateTimeZone(
$ccShowDay->getDbTimezone()
));
$lastShowEndDT = Application_Service_CalendarService::addDeltas(
$lastShowStartDT,
1,
0
);
$ccShowDay
->setDbLastShow($lastShowEndDT->format('Y-m-d'))
->save();
}
}
// NOTE: Some cc_show_day records may not get updated because there may not be an instance
// left on one of the repeating days so we have to find the entries where the last_show is
// still null
$showDays = CcShowDaysQuery::create()
->filterByDbShowId($showId)
->filterByDbRepeatType(0, Criteria::GREATER_EQUAL)
->filterByDbLastShow(null)
->find();
foreach ($showDays as $showDay) {
$showDay->setDbLastShow($showDay->getDbFirstShow())->save();
}
}
private function checkToDeleteCcShow($showId)
{
// check if there are any non deleted show instances remaining.
$ccShowInstances = CcShowInstancesQuery::create()
->filterByDbShowId($showId)
->filterByDbModifiedInstance(false)
->filterByDbRebroadcast(0)
->orderByDbStarts()
->find();
if ($ccShowInstances->isEmpty()) {
return true;
}
return false;
}
private function deleteAllInstances($showId)
{
$sql = <<<'SQL'
DELETE
FROM cc_show_instances
WHERE starts > :timestamp::TIMESTAMP
AND show_id = :showId
SQL;
Application_Common_Database::prepareAndExecute(
$sql,
[
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
':showId' => $showId,
],
'execute'
);
}
private function deleteAllRepeatInstances($currentShowDay, $showId)
{
$firstShow = $currentShowDay->getUTCStartDateAndTime();
$sql = <<<'SQL'
DELETE
FROM cc_show_instances
WHERE starts > :timestamp::TIMESTAMP
AND show_id = :showId
AND starts != :firstShow
SQL;
Application_Common_Database::prepareAndExecute(
$sql,
[
':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
':showId' => $showId,
':firstShow' => $firstShow->format(DEFAULT_TIMESTAMP_FORMAT),
],
'execute'
);
}
/**
* Determines what the show end date should be based on
* the form data.
*
* @param $showData add/edit show form data
*
* @return DateTime object in user's local timezone
*/
private function calculateEndDate($showData)
{
// if no end return null
if ($showData['add_show_no_end']) {
$endDate = null;
}
// if the show is repeating & ends, then return the end date
elseif ($showData['add_show_repeats']) {
$endDate = new DateTime(
$showData['add_show_end_date'],
new DateTimeZone($showData['add_show_timezone'])
);
$endDate->add(new DateInterval('P1D'));
}
// the show doesn't repeat, so add one day to the start date.
else {
$endDate = new DateTime(
$showData['add_show_start_date'],
new DateTimeZone($showData['add_show_timezone'])
);
$endDate->add(new DateInterval('P1D'));
}
return $endDate;
}
private function updateScheduleStartEndTimes($showData)
{
$showId = $this->ccShow->getDbId();
// DateTime in show's local time
$newStartDateTime = new DateTime(
$showData['add_show_start_date']
. ' '
. $showData['add_show_start_time'],
new DateTimeZone($showData['add_show_timezone'])
);
$diff = $this->calculateShowStartDiff(
$newStartDateTime,
$this->origCcShowDay->getLocalStartDateAndTime()
);
Application_Service_SchedulerService::updateScheduleStartTime(
$this->instanceIdsForScheduleUpdates,
$diff
);
}
/**
* Returns the difference in seconds between a show's new and
* old start time.
*
* @param $newStartDateTime DateTime object
* @param $oldStartDateTime DateTime object
*/
private function calculateShowStartDiff($newStartDateTime, $oldStartDateTime)
{
return $newStartDateTime->getTimestamp() - $oldStartDateTime->getTimestamp();
}
/**
* Updates the start and end time for cc_show_instances.
*
* @param mixed $diff
*/
private function updateInstanceStartEndTime($diff)
{
$sql = <<<'SQL'
UPDATE cc_show_instances
SET starts = starts + :diff1::INTERVAL,
ends = ends + :diff2::INTERVAL
WHERE show_id = :showId
AND starts > :timestamp::TIMESTAMP
SQL;
Application_Common_Database::prepareAndExecute(
$sql,
[
':diff1' => $diff, ':diff2' => $diff,
':showId' => $this->ccShow->getDbId(), ':timestamp' => gmdate(DEFAULT_TIMESTAMP_FORMAT),
],
'execute'
);
}
/**
* Enter description here ...
*
* @param ccShowDays $showDay
* @param DateTime $showStartDate user's local time
* @param mixed $instanceId
*/
private function createRebroadcastInstances($showDay, $showStartDate, $instanceId)
{
$currentUtcTimestamp = gmdate(DEFAULT_TIMESTAMP_FORMAT);
$showId = $this->ccShow->getDbId();
$sql = 'SELECT * FROM cc_show_rebroadcast WHERE show_id=:show_id';
$rebroadcasts = Application_Common_Database::prepareAndExecute(
$sql,
[':show_id' => $showId],
'all'
);
foreach ($rebroadcasts as $rebroadcast) {
$days = explode(' ', $rebroadcast['day_offset']);
$time = explode(':', $rebroadcast['start_time']);
$offset = ['days' => $days[0], 'hours' => $time[0], 'mins' => $time[1]];
[$utcStartDateTime, $utcEndDateTime] = $this->createUTCStartEndDateTime(
$showStartDate,
$showDay->getDbDuration(),
$offset
);
if ($utcStartDateTime->format(DEFAULT_TIMESTAMP_FORMAT) > $currentUtcTimestamp) {
$ccShowInstance = new CcShowInstances();
$ccShowInstance->setDbShowId($showId);
$ccShowInstance->setDbStarts($utcStartDateTime);
$ccShowInstance->setDbEnds($utcEndDateTime);
$ccShowInstance->setDbRecord(0);
$ccShowInstance->setDbRebroadcast(1);
$ccShowInstance->setDbOriginalShow($instanceId);
$ccShowInstance->save();
}
}
}
/**
* Sets a single cc_show_instance table row.
*
* @param mixed $showDay
* @param mixed $populateUntil
*/
private function createNonRepeatingInstance($showDay, $populateUntil)
{
// DateTime object
$start = $showDay->getLocalStartDateAndTime();
[$utcStartDateTime, $utcEndDateTime] = $this->createUTCStartEndDateTime(
$start,
$showDay->getDbDuration()
);
if ($utcStartDateTime->getTimestamp() < $populateUntil->getTimestamp()) {
$ccShowInstance = new CcShowInstances();
if ($this->isUpdate) {
// use original cc_show_day object to get the current cc_show_instance
$origStartDateTime = new DateTime(
$this->origCcShowDay->getDbFirstShow() . ' ' . $this->origCcShowDay->getDbStartTime(),
new DateTimeZone($this->origCcShowDay->getDbTimezone())
);
$origStartDateTime->setTimezone(new DateTimeZone('UTC'));
$ccShowInstance = $this->getInstance($origStartDateTime);
if (!$ccShowInstance) {
throw new Exception('Could not find show instance with start time: ' . $origStartDateTime->format(DEFAULT_TIMESTAMP_FORMAT));
}
}
$ccShowInstance->setDbShowId($this->ccShow->getDbId());
$ccShowInstance->setDbStarts($utcStartDateTime);
$ccShowInstance->setDbEnds($utcEndDateTime);
$ccShowInstance->setDbRecord($showDay->getDbRecord());
$ccShowInstance->save();
if ($this->isRebroadcast) {
$this->createRebroadcastInstances($showDay, $start, $ccShowInstance->getDbId());
}
}
return $ccShowInstance;
}
/**
* Sets multiple cc_show_instances table rows.
*
* @param unknown_type $showDay
* @param unknown_type $populateUntil
* @param unknown_type $repeatInterval
* @param mixed $repeatType
* @param null|mixed $daysAdded
*/
private function createWeeklyRepeatInstances(
$showDay,
$populateUntil,
$repeatType,
$repeatInterval,
$daysAdded = null
) {
$show_id = $showDay->getDbShowId();
$first_show = $showDay->getDbFirstShow(); // non-UTC
$last_show = $showDay->getDbLastShow(); // non-UTC
$duration = $showDay->getDbDuration();
$day = $showDay->getDbDay();
$record = $showDay->getDbRecord();
$timezone = $showDay->getDbTimezone();
// DateTime local
$start = $this->getNextRepeatingPopulateStartDateTime($showDay);
if (is_null($repeatInterval) && $repeatType == REPEAT_MONTHLY_WEEKLY) {
$repeatInterval = self::getMonthlyWeeklyRepeatInterval($start, $timezone);
}
// DatePeriod in user's local time
$datePeriod = $this->getDatePeriod(
$start,
$timezone,
$last_show,
$repeatInterval,
$populateUntil
);
if ($last_show) {
$utcLastShowDateTime = new DateTime($last_show, new DateTimeZone($timezone));
$utcLastShowDateTime->setTimezone(new DateTimeZone('UTC'));
} else {
$utcLastShowDateTime = null;
}
$previousDate = clone $start;
foreach ($datePeriod as $date) {
[$utcStartDateTime, $utcEndDateTime] = $this->createUTCStartEndDateTime(
$date,
$duration
);
/*
* Make sure start date is less than populate until date AND
* last show date is null OR start date is less than last show date
*/
if (
$utcStartDateTime <= $populateUntil
&& (is_null($utcLastShowDateTime) || $utcStartDateTime < $utcLastShowDateTime)
) {
$lastCreatedShow = clone $utcStartDateTime;
/* There may not always be an instance when editing a show
* This will be the case when we are adding a new show day to
* a repeating show
*/
if ($this->isUpdate) {
if ($this->hasInstance($utcStartDateTime)) {
$ccShowInstance = $this->getInstance($utcStartDateTime);
$newInstance = false;
} else {
$newInstance = true;
$ccShowInstance = new CcShowInstances();
}
} else {
$newInstance = true;
$ccShowInstance = new CcShowInstances();
}
/* When editing the start/end time of a repeating show, we don't want to
* change shows that are in the past so we check the end time.
*/
if ($newInstance || $ccShowInstance->getDbEnds() > gmdate(DEFAULT_TIMESTAMP_FORMAT)) {
$ccShowInstance->setDbShowId($show_id);
$ccShowInstance->setDbStarts($utcStartDateTime);
$ccShowInstance->setDbEnds($utcEndDateTime);
$ccShowInstance->setDbRecord($record);
$ccShowInstance->save();
}
if ($newInstance) {
array_push($this->newInstanceIdsCreated[$show_id], $ccShowInstance->getDbId());
}
if ($this->isRebroadcast) {
$this->createRebroadcastInstances($showDay, $date, $ccShowInstance->getDbId());
}
}
$previousDate = clone $date;
}
/* We need to set the next populate date for repeat shows so when a user
* moves forward in the calendar we know when to start generating new
* show instances.
* If $utcStartDateTime is not set then we know zero new shows were
* created and we shouldn't update the next populate date.
*/
if (isset($lastCreatedShow)) {
/* Set UTC to local time before setting the next repeat date. If we don't
* the next repeat date might be scheduled for the following day
* THIS MUST BE IN THE TIMEZONE THE SHOW WAS CREATED IN */
$lastCreatedShow->setTimezone(new DateTimeZone($timezone));
$nextDate = $lastCreatedShow->add($repeatInterval);
$this->setNextRepeatingShowDate($nextDate->format('Y-m-d'), $day, $show_id);
}
}
private function createMonthlyRepeatInstances($showDay, $populateUntil)
{
$show_id = $showDay->getDbShowId();
$first_show = $showDay->getDbFirstShow(); // non-UTC
$last_show = $showDay->getDbLastShow(); // non-UTC
$duration = $showDay->getDbDuration();
$day = $showDay->getDbDay();
$record = $showDay->getDbRecord();
$timezone = $showDay->getDbTimezone();
// DateTime local
$start = $this->getNextRepeatingPopulateStartDateTime($showDay);
if (isset($last_show)) {
$end = new DateTime($last_show, new DateTimeZone($timezone));
} else {
$end = $populateUntil;
}
// We will only need this if the repeat type is MONTHLY_WEEKLY
[$weekNumberOfMonth, $dayOfWeek] = self::getMonthlyWeeklyRepeatInterval(
new DateTime($first_show, new DateTimeZone($timezone))
);
$this->repeatType = $showDay->getDbRepeatType();
if ($last_show) {
$utcLastShowDateTime = new DateTime($last_show, new DateTimeZone($timezone));
$utcLastShowDateTime->setTimezone(new DateTimeZone('UTC'));
} else {
$utcLastShowDateTime = null;
}
while ($start->getTimestamp() < $end->getTimestamp()) {
[$utcStartDateTime, $utcEndDateTime] = $this->createUTCStartEndDateTime(
$start,
$duration
);
/*
* Make sure start date is less than populate until date AND
* last show date is null OR start date is less than last show date
*/
if (
$utcStartDateTime->getTimestamp() <= $populateUntil->getTimestamp()
&& (is_null($utcLastShowDateTime)
|| $utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp())
) {
$lastCreatedShow = clone $utcStartDateTime;
/* There may not always be an instance when editing a show
* This will be the case when we are adding a new show day to
* a repeating show
*/
if ($this->isUpdate && $this->hasInstance($utcStartDateTime)) {
$ccShowInstance = $this->getInstance($utcStartDateTime);
$newInstance = false;
} else {
$newInstance = true;
$ccShowInstance = new CcShowInstances();
}
/* When editing the start/end time of a repeating show, we don't want to
* change shows that started in the past. So check the start time.
*/
if ($newInstance || $ccShowInstance->getDbStarts() > gmdate(DEFAULT_TIMESTAMP_FORMAT)) {
$ccShowInstance->setDbShowId($show_id);
$ccShowInstance->setDbStarts($utcStartDateTime);
$ccShowInstance->setDbEnds($utcEndDateTime);
$ccShowInstance->setDbRecord($record);
$ccShowInstance->save();
}
if ($newInstance) {
array_push($this->newInstanceIdsCreated[$show_id], $ccShowInstance->getDbId());
}
if ($this->isRebroadcast) {
$this->createRebroadcastInstances($showDay, $start, $ccShowInstance->getDbId());
}
}
if ($this->repeatType == REPEAT_MONTHLY_WEEKLY) {
$monthlyWeeklyStart = new DateTime(
$utcStartDateTime->format('Y-m'),
new DateTimeZone('UTC')
);
$monthlyWeeklyStart->add(new DateInterval('P1M'));
$start = self::getNextMonthlyWeeklyRepeatDate(
$monthlyWeeklyStart,
$timezone,
$showDay->getDbStartTime(),
$weekNumberOfMonth,
$dayOfWeek
);
} else {
$start = $this->getNextMonthlyMonthlyRepeatDate(
$start,
$timezone,
$showDay->getDbStartTime()
);
}
}
$this->setNextRepeatingShowDate($start->format('Y-m-d'), $day, $show_id);
}
/**
* i.e. last thursday of each month
* i.e. second monday of each month.
*
* @param string $showStart
*/
public static function getMonthlyWeeklyRepeatInterval($showStart)
{
$start = clone $showStart;
$dayOfMonth = $start->format('j');
$dayOfWeek = $start->format('l');
$yearAndMonth = $start->format('Y-m');
$firstDayOfWeek = strtotime($dayOfWeek . ' ' . $yearAndMonth);
// if $dayOfWeek is Friday, what number of the month does
// the first Friday fall on
$numberOfFirstDayOfWeek = date('j', $firstDayOfWeek);
$weekCount = 0;
while ($dayOfMonth >= $numberOfFirstDayOfWeek) {
++$weekCount;
$dayOfMonth -= 7;
}
switch ($weekCount) {
case 1:
$weekNumberOfMonth = 'first';
break;
case 2:
$weekNumberOfMonth = 'second';
break;
case 3:
$weekNumberOfMonth = 'third';
break;
case 4:
$weekNumberOfMonth = 'fourth';
break;
case 5:
$weekNumberOfMonth = 'fifth';
break;
}
/* return DateInterval::createFromDateString(
$weekNumberOfMonth." ".$dayOfWeek." of next month"); */
return [$weekNumberOfMonth, $dayOfWeek];
}
/**
* Enter description here ...
*
* @param $start user's local time
* @param mixed $timezone
* @param mixed $startTime
*/
private function getNextMonthlyMonthlyRepeatDate($start, $timezone, $startTime)
{
$dt = new DateTime($start->format('Y-m'), new DateTimeZone($timezone));
do {
$dt->add(new DateInterval('P1M'));
} while (!checkdate($dt->format('m'), $start->format('d'), $dt->format('Y')));
$dt->setDate($dt->format('Y'), $dt->format('m'), $start->format('d'));
$startTime = explode(':', $startTime);
$hours = isset($startTime[0]) ? $startTime[0] : '00';
$minutes = isset($startTime[1]) ? $startTime[1] : '00';
$seconds = isset($startTime[2]) ? $startTime[2] : '00';
$dt->setTime($hours, $minutes, $seconds);
return $dt;
}
/**
* Returns a DateTime object of when the next repeating show that repeats
* monthly, by day of the week (i.e. every fourth Tuesday) should be created.
*
* @param DateTime $start
* $start only has the year and month of the next show
* @param string $timezone
* @param string (i.e. '14:30' $startTime
* @param string (i.e. 'first', 'second') $weekNumberOfMonth
* @param string (i.e. 'Monday') $dayOfWeek
*/
public static function getNextMonthlyWeeklyRepeatDate(
$start,
$timezone,
$startTime,
$weekNumberOfMonth,
$dayOfWeek
) {
$dt = new DateTime($start->format('Y-m'), new DateTimeZone($timezone));
$tempDT = clone $dt;
$fifthWeekExists = false;
do {
$nextDT = date_create($weekNumberOfMonth . ' ' . $dayOfWeek
. ' of ' . $tempDT->format('F') . ' ' . $tempDT->format('Y'));
$nextDT->setTimezone(new DateTimeZone($timezone));
/* We have to check if the next date is in the same month in case
* the repeat day is in the fifth week of the month.
* If it's not in the same month we know that a fifth week of
* the next month does not exist. So let's skip it.
*/
if ($tempDT->format('F') == $nextDT->format('F')) {
$fifthWeekExists = true;
}
$tempDT->add(new DateInterval('P1M'));
} while (!$fifthWeekExists);
$dt = $nextDT;
$startTime = explode(':', $startTime);
$hours = isset($startTime[0]) ? $startTime[0] : '00';
$minutes = isset($startTime[1]) ? $startTime[1] : '00';
$seconds = isset($startTime[2]) ? $startTime[2] : '00';
$dt->setTime($hours, $minutes, $seconds);
return $dt;
}
private function getNextRepeatingPopulateStartDateTime($showDay)
{
$nextPopDate = $showDay->getDbNextPopDate();
$startTime = $showDay->getDbStartTime();
if (isset($nextPopDate)) {
return new DateTime($nextPopDate . ' ' . $startTime, new DateTimeZone($showDay->getDbTimezone()));
}
return new DateTime($showDay->getDbFirstShow() . ' ' . $startTime, new DateTimeZone($showDay->getDbTimezone()));
}
/**
* Create a DatePeriod object in the user's local time
* It will get converted to UTC before the show instance gets created.
*
* @param mixed $start
* @param mixed $timezone
* @param mixed $lastShow
* @param mixed $repeatInterval
* @param mixed $populateUntil
*/
private function getDatePeriod($start, $timezone, $lastShow, $repeatInterval, $populateUntil)
{
if (isset($lastShow)) {
$endDatePeriod = new DateTime($lastShow, new DateTimeZone($timezone));
} else {
$endDatePeriod = $populateUntil;
}
return new DatePeriod($start, $repeatInterval, $endDatePeriod);
}
private function hasInstance($starts)
{
return $this->getInstance($starts) ? true : false;
}
/**
* Attempts to retrieve the cc_show_instance belonging to a cc_show
* that starts at $starts. We have to pass in the start
* time in case the show is repeating.
*
* Returns the instance if one was found (one that is not a recording
* and modified instance is false (has not been deleted))
*
* @param mixed $starts
*/
private function getInstance($starts)
{
$temp = clone $starts;
$temp->setTimezone(new DateTimeZone($this->oldShowTimezone));
$temp->setTime($this->localShowStartHour, $this->localShowStartMin);
$temp->setTimezone(new DateTimeZone('UTC'));
$ccShowInstance = CcShowInstancesQuery::create()
->filterByDbStarts($temp->format(DEFAULT_TIMESTAMP_FORMAT), Criteria::EQUAL)
->filterByDbShowId($this->ccShow->getDbId(), Criteria::EQUAL)
// ->filterByDbModifiedInstance(false, Criteria::EQUAL)
->filterByDbRebroadcast(0, Criteria::EQUAL)
->limit(1)
->find();
if ($ccShowInstance->isEmpty()) {
return false;
}
return $ccShowInstance[0];
}
private function hasCcShowDay($repeatType, $day)
{
return $this->getCcShowDay($repeatType, $day) ? true : false;
}
private function getCcShowDay($repeatType, $day)
{
$ccShowDay = CcShowDaysQuery::create()
->filterByDbShowId($this->ccShow->getDbId())
->filterByDbDay($day)
->filterByDbRepeatType($repeatType)
->limit(1)
->find();
if ($ccShowDay->isEmpty()) {
return false;
}
return $ccShowDay[0];
}
/**
* Sets the fields for a cc_show table row.
*
* @param mixed $showData
*/
public function setCcShow($showData)
{
if (!$this->isUpdate) {
$ccShow = new CcShow();
} else {
$ccShow = CcShowQuery::create()->findPk($showData['add_show_id']);
}
$ccShow->setDbName($showData['add_show_name']);
$ccShow->setDbDescription($showData['add_show_description']);
$ccShow->setDbUrl($showData['add_show_url']);
$ccShow->setDbGenre($showData['add_show_genre']);
$ccShow->setDbColor($showData['add_show_color']);
$ccShow->setDbBackgroundColor($showData['add_show_background_color']);
$ccShow->setDbLiveStreamUsingAirtimeAuth($showData['cb_airtime_auth'] == 1);
$ccShow->setDbLiveStreamUsingCustomAuth($showData['cb_custom_auth'] == 1);
$ccShow->setDbLiveStreamUser($showData['custom_username']);
$ccShow->setDbLiveStreamPass($showData['custom_password']);
$ccShow->setDbHasAutoPlaylist($showData['add_show_has_autoplaylist'] == 1);
$ccShow->setDbAutoPlaylistRepeat($showData['add_show_autoplaylist_repeat'] == 1);
// added to prevent errors with insert due to a lack of data
if ($showData['add_show_autoplaylist_id'] != '') {
$ccShow->setDbAutoPlaylistId($showData['add_show_autoplaylist_id']);
}
$ccShow->setDbOverrideIntroPlaylist($showData['add_show_intro_playlist_id'] != 0);
if ($showData['add_show_intro_playlist_id'] != '') {
$ccShow->setDbIntroPlaylistId($showData['add_show_intro_playlist_id']);
}
$ccShow->setDbOverrideOutroPlaylist($showData['add_show_outro_playlist_id'] != 0);
if ($showData['add_show_outro_playlist_id'] != '') {
$ccShow->setDbOutroPlaylistId($showData['add_show_outro_playlist_id']);
}
// Here a user has edited a show and linked it.
// We need to grab the existing show instances ids and fill their content
// with the content from the show instance that was clicked on to edit the show.
// We do this because linked show instances need to have the same content in each.
if ($this->isUpdate && (!$ccShow->getDbLinked() && $showData['add_show_linked'])) {
$existingShowInstanceIds = $ccShow->getFutureInstanceIds(new Criteria());
Application_Service_SchedulerService::fillLinkedInstances($ccShow, $existingShowInstanceIds, $showData['add_show_instance_id']);
}
$ccShow->setDbLinked($showData['add_show_linked']);
$ccShow->save();
$this->ccShow = $ccShow;
}
/**
* Sets the fields for a cc_show_days table row.
*
* @param mixed $showData
*/
private function setCcShowDays($showData)
{
$showId = $this->ccShow->getDbId();
$startDateTime = new DateTime(
$showData['add_show_start_date'] . ' ' . $showData['add_show_start_time'],
new DateTimeZone($showData['add_show_timezone'])
);
$endDateTime = $this->calculateEndDate($showData);
if (!is_null($endDateTime)) {
$endDate = $endDateTime->format('Y-m-d');
} else {
$endDate = null;
}
// Our calculated start DOW must be used for non repeating since a day has not been selected.
// For all repeating shows, only the selected days of the week will be repeated on.
$startDow = $startDateTime->format('w');
if (!$showData['add_show_repeats']) {
$showData['add_show_day_check'] = [$startDow];
}
// Don't set day for monthly repeat type, it's invalid
if ($showData['add_show_repeats'] && $showData['add_show_repeat_type'] == 2) {
if ($this->isUpdate) {
$showDay = CcShowDaysQuery::create()
->filterByDbShowId($showId)
->filterByDbRepeatType($this->origCcShowDay->getDbRepeatType())
->findOne();
if (!$showDay) {
// repeat type changed so we have to create a new show_day rule
$showDay = new CcShowDays();
}
} else {
$showDay = new CcShowDays();
}
$showDay->setDbFirstShow($startDateTime->format('Y-m-d'));
$showDay->setDbLastShow($endDate);
$showDay->setDbStartTime($startDateTime->format('H:i:s'));
$showDay->setDbTimezone($showData['add_show_timezone']);
$showDay->setDbDuration($showData['add_show_duration']);
$showDay->setDbRepeatType($this->repeatType);
$showDay->setDbShowId($showId);
$showDay->setDbRecord($this->isRecorded);
// in case we are editing a show we need to set this to the first show
// so when editing, the date period iterator will start from the beginning
$showDay->setDbNextPopDate($startDateTime->format('Y-m-d'));
$showDay->save();
} else {
foreach ($showData['add_show_day_check'] as $day) {
$daysAdd = 0;
$startDateTimeClone = clone $startDateTime;
if ($startDow !== $day) {
if ($startDow > $day) {
$daysAdd = 6 - $startDow + 1 + $day;
} else {
$daysAdd = $day - $startDow;
}
$startDateTimeClone->add(new DateInterval('P' . $daysAdd . 'D'));
}
if (is_null($endDate) || $startDateTimeClone->getTimestamp() <= $endDateTime->getTimestamp()) {
if ($this->isUpdate) {
if (
$this->origCcShowDay->getDbRepeatType() == 2
|| $this->origCcShowDay->getDbRepeatType() == 3
) {
$day = null;
} elseif (!$this->origShowRepeatStatus) {
// keep current show day to use for updating cc_show_day rule
$keepDay = $day;
$day = $this->origCcShowDay->getDbDay();
}
$showDay = CcShowDaysQuery::create()
->filterByDbShowId($showId)
->filterByDbRepeatType($this->origCcShowDay->getDbRepeatType())
->filterByDbDay($day)
->findOne();
if (!$showDay) {
// if no show day object was found it is because a new
// repeating day of the week was added OR the repeat
// type has changed
$showDay = new CcShowDays();
}
if (isset($keepDay)) {
$day = $keepDay;
}
} else {
$showDay = new CcShowDays();
}
$showDay->setDbFirstShow($startDateTimeClone->format('Y-m-d'));
$showDay->setDbLastShow($endDate);
$showDay->setDbStartTime($startDateTimeClone->format('H:i'));
$showDay->setDbTimezone($showData['add_show_timezone']);
$showDay->setDbDuration($showData['add_show_duration']);
$showDay->setDbDay($day);
$showDay->setDbRepeatType($this->repeatType);
$showDay->setDbShowId($showId);
$showDay->setDbRecord($this->isRecorded);
// in case we are editing a show we need to set this to the first show
// so when editing, the date period iterator will start from the beginning
$showDay->setDbNextPopDate($startDateTimeClone->format('Y-m-d'));
$showDay->save();
}
}
}
}
/**
* Deletes all the cc_show_rebroadcast entries for a specific show
* that is currently being edited. They will get recreated with
* the new show specs.
*/
private function deleteCcShowRebroadcasts()
{
CcShowRebroadcastQuery::create()->filterByDbShowId($this->ccShow->getDbId())->delete();
}
/**
* Sets the fields for a cc_show_rebroadcast table row.
*
* @param mixed $showData
*/
private function setCcShowRebroadcasts($showData)
{
$showId = $this->ccShow->getDbId();
if (($this->isRecorded && $showData['add_show_rebroadcast']) && ($this->repeatType != -1)) {
for ($i = 1; $i <= MAX_REBROADCAST_DATES; ++$i) {
if ($showData['add_show_rebroadcast_date_' . $i]) {
$showRebroad = new CcShowRebroadcast();
$showRebroad->setDbDayOffset($showData['add_show_rebroadcast_date_' . $i]);
$showRebroad->setDbStartTime($showData['add_show_rebroadcast_time_' . $i]);
$showRebroad->setDbShowId($showId);
$showRebroad->save();
}
}
} elseif ($this->isRecorded && $showData['add_show_rebroadcast'] && ($this->repeatType == -1)) {
for ($i = 1; $i <= MAX_REBROADCAST_DATES; ++$i) {
if ($showData['add_show_rebroadcast_date_absolute_' . $i]) {
$rebroadcastDate = new DateTime($showData["add_show_rebroadcast_date_absolute_{$i}"]);
$startDate = new DateTime($showData['add_show_start_date']);
$offsetDays = $startDate->diff($rebroadcastDate);
$showRebroad = new CcShowRebroadcast();
$showRebroad->setDbDayOffset($offsetDays->format('%a days'));
$showRebroad->setDbStartTime($showData['add_show_rebroadcast_time_absolute_' . $i]);
$showRebroad->setDbShowId($showId);
$showRebroad->save();
}
}
}
}
/**
* Deletes all the cc_show_hosts entries for a specific show
* that is currently being edited. They will get recreated with
* the new show specs.
*/
private function deleteCcShowHosts()
{
CcShowHostsQuery::create()->filterByDbShow($this->ccShow->getDbId())->delete();
}
/**
* Sets the fields for a cc_show_hosts table row.
*
* @param mixed $showData
*/
private function setCcShowHosts($showData)
{
if (is_array($showData['add_show_hosts'])) {
foreach ($showData['add_show_hosts'] as $host) {
$showHost = new CcShowHosts();
$showHost->setDbShow($this->ccShow->getDbId());
$showHost->setDbHost($host);
$showHost->save();
}
}
}
/**
* Gets the date and time shows (particularly repeating shows)
* can be populated until.
*
* @return DateTime object
*/
private static function getPopulateShowUntilDateTIme()
{
$populateUntil = Application_Model_Preference::GetShowsPopulatedUntil();
if (is_null($populateUntil)) {
$populateUntil = new DateTime('now', new DateTimeZone('UTC'));
Application_Model_Preference::SetShowsPopulatedUntil($populateUntil);
}
return $populateUntil;
}
/**
* Enter description here ...
*
* @param DateTime $showStart user's local time
* @param string $duration time interval (h)h:(m)m(:ss)
* @param array $offset (days, hours, mins) used for rebroadcast shows
*
* @return array of 2 DateTime objects, start/end time of the show in UTC
*/
private function createUTCStartEndDateTime($showStart, $duration, $offset = null)
{
$startDateTime = clone $showStart;
$timezone = $startDateTime->getTimezone();
if (isset($offset)) {
// $offset["hours"] and $offset["mins"] represents the start time
// of a rebroadcast show
$startDateTime = new DateTime($startDateTime->format('Y-m-d') . ' '
. $offset['hours'] . ':' . $offset['mins'], $timezone);
$startDateTime->add(new DateInterval("P{$offset['days']}D"));
}
$endDateTime = clone $startDateTime;
$duration = explode(':', $duration);
[$hours, $mins] = array_slice($duration, 0, 2);
$endDateTime->add(new DateInterval("PT{$hours}H{$mins}M"));
$startDateTime->setTimezone(new DateTimeZone('UTC'));
$endDateTime->setTimezone(new DateTimeZone('UTC'));
return [$startDateTime, $endDateTime];
}
/**
* Show instances for repeating shows only get created up
* until what is visible on the calendar. We need to set the
* date for when the next repeating show instance should be created
* as the user browses the calendar further.
*
* @param mixed $nextDate
* @param mixed $day
* @param mixed $showId
*/
private function setNextRepeatingShowDate($nextDate, $day, $showId)
{
$nextInfo = explode(' ', $nextDate);
$repeatInfo = CcShowDaysQuery::create()
->filterByDbShowId($showId)
->filterByDbDay($day)
->filterByDbRepeatType(-1, Criteria::NOT_EQUAL)
->findOne();
$repeatInfo->setDbNextPopDate($nextInfo[0])
->save();
}
}