Mass-converts all array() literals to [] across lib/, tpl/, tst/ as
discussed in #1640. PHP supports short array syntax since 5.4 and the
project's required PHP version is 7.4+, so this is a pure stylistic
change with no behavior impact.
Also flips the StyleCI configuration so future PRs are checked against
short_array_syntax instead of long_array_syntax. Per @elrido in #1640,
the StyleCI swap and the mass change need to land together so no
branch breaks under the wrong rule.
Generated with `php-cs-fixer fix --rules=array_syntax` against the
.styleci.yml finder paths. 39 files touched, 487 insertions / 487
deletions (every change is a single-token replacement). Verified:
- `php -l` clean on all touched files
- `phpunit` from `tst/`: 230 / 230 tests pass (with 6329 assertions),
excluding `ControllerWithGcsTest` which fails on PHP 8.5 because of
an unrelated upstream `google/cloud-core` deprecation. The same 14
GCS-suite errors reproduce on `master` before this change.
Closes#1640
- added missing exception doc blocks
- introduced exception type that translates message during construction
- catch explicit exception types where possible
Some of the references to "paste" in code or comments got changed as well, but to clarify the intended usage of the terms:
- A PrivateBin document can consist of a paste text (key "paste" in the encrypted payload) and one or several attachments and discussion entries.
- Internally the root document is called a "Paste" and each discussion entry is called a "Discussion".
- When referring to a whole document with one paste and optional discussion(s), we call it just "document".
- When talking about a particular JSON payload type in the internal logic, i.e. during storage or transmission, we call them a paste or discussion to distinguish which type we refer to.
closes#397
- @version in file header level isn't used on code docs, it is intended
for API versions at class or method level
- avoids needing to update all these files on version increment
- avoids needing to regenerate SRI hashes for privatebin.js through
extra phpunit run
- simplifies VERSION_FILES list
- avoids having to filter above list during loop
- adds a few missing doc bloc headers