1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-08-06 15:54:05 +00:00
Commit graph

41 commits

Author SHA1 Message Date
3156c87ee3
phpstan fixes
old ignore no longer necessary, two new ignores are needed (the added
ignores are not necessary in PHP 8.5 but at this time our CI still runs
on PHP 8.4)
2026-06-30 19:33:30 -07:00
7089efb2ee resolve minor todos 2025-08-18 15:05:17 +02:00
7481229063 revert regression in last commit, opt for a phpstan ignore instead 2025-06-19 00:12:38 +02:00
12fcbabd76 phpstan fix 2025-06-18 23:52:35 +02:00
Márk Magyar
79f740d057
[4.x] General code cleanup (#1278)
* Declare sensitive parameters as sensitive

... just so that they don't show up in logs

* Remove unnecessary null-coalescing

* Simplify return

* Merge isset() calls

* Inline return

* Use nullsafe operator

* Simplify if-else branches

* Use direct empty string comparison instead of strlen()

* Add missing type

* Change interface as events expect a TenantWithDatabase not just a Tenant

* Narrow typehint

* Remove redundant type casts

* Fix style with php-cs-fixer

* Fix typos

* Revert unwanted if-else simplification

* fix phpstan errors

* narrow type

---------

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2024-12-31 00:35:46 +01:00
a37dc9b449 reimplement broadcasting channel helpers to support model binding 2024-10-03 21:12:09 +02:00
7572911d87 remove dead code 2024-05-28 02:55:13 +02:00
20c1b9a940 phpcsfixer: enable nullable_type_declaration_for_default_null_value 2024-04-09 20:55:49 +02:00
a0da54cfdc categorize todos 2024-03-12 17:29:00 +01:00
PHP CS Fixer
8a269f8dd8 Fix code style (php-cs-fixer) 2024-03-01 07:42:38 +00:00
lukinovec
df9324b92f
Stop bypassing tenancy initializition when domain is central in domain ID MW (#24)
* Stop bypassing tenancy initialization when host is central domain in domain ID MW

* Delete dataset for testing global domain ID MW + route-level prevent access MW

* Provide ID MW statically in TenantAssetController

* Fix code style (php-cs-fixer)

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2024-01-03 23:35:49 +01:00
lukinovec
c34952f328
Add broadcasting channel prefixing bootstrapper (#12)
* Rename old broadcast bootstrapper, add new one

* Add broadcast tenancy bootstrapper + tests

* Fix code style (php-cs-fixer)

* Fix prefixing

* Work on th bootstrapper's tests (wip – problem with events)

* Fix bootstrapper

* Test that auth closures of channels work correctly

* Fix bootstrapper

* Fix code style (php-cs-fixer)

* Delete channel cloning bootstrapper

* Add bootstrapper that prefixes broadcastOn channels under the hood

* Add broadcast channel registering helpers

* Update prefixing tests (WIP)

* Fix code style (php-cs-fixer)

* Improve comment

* Fix code style (php-cs-fixer)

* Allow customization of Pusher/Ably broadcaster extension

* Fix code style (php-cs-fixer)

* Implement prefix bootstrapper logic, test channel prefixing using a closure

* Work on the prefixing bootstrapper and tests

* Fix code style (php-cs-fixer)

* Add optional $options param to broadcasting helpers

* Test broadcasting helpers

* Fix code style (php-cs-fixer)

* Broadcasting channel prefixing + testing progress

* Improve helper methods

* Fix and improve test

* Fix extending in bootstrap()

* Fix code style (php-cs-fixer)

* Add docblocks, name things more accurately

* Fix code style (php-cs-fixer)

* Delete redundant method from testing broadcaster

* Test Pusher channel prefixing (probabaly redundant?)

* Test if channels get prefixed correctly when switching tenants

* Work with the current broadcast manager instead of overriding it

* Give the original channels to the overriden broadcasters

* Fix code style (php-cs-fixer)

* Simplify channel prefix bootstrapper

* Fix code style (php-cs-fixer)

* Fix comment

* Fix test

* Delete annotation

* Delete unused classes from test

* Delete outdated test

* Move broadcasting bootstrapper test to BootstrapperTest

* Improve bootstrapper test, delete unused event

* Add annotations to the bootstrapper

* Fix code style (php-cs-fixer)

* Improve wording

* Improve comment

* Update src/Bootstrappers/BroadcastChannelPrefixBootstrapper.php

* Apply suggestions from code review

* Optionally skip prefixing of specific channels

* Add and test central channel helper, update formatChannels overrides and tests

* Fix code style (php-cs-fixer)

* minor fixes

* Improve annotation

* Use "global__" prefix instead of "central__", add comments

* Correct tests

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2023-11-06 22:09:01 +01:00
lukinovec
8d38f42cd0
Correct asset helpers, make asset helpers work with path identification (#6)
* Make asset_helper_tenancy false by default

* Make tenant_asset() respect ASSET_URL

* Set asset helper tenancy to true in tests where needed

* If the `asset_helper_tenancy` key is missing, default to false in filesystem bootstrapper

* Make temporary clone action changes

* Make tenancy asset route universal

* Make the asset controller's asset method behave differently if path ID MW is the default

* Test that asset helper works with path identification

* Fix code style (php-cs-fixer)

* Delete path traversal attack prevention

* Fix code style (php-cs-fixer)

* Skip cloning of stancl.tenancy.asset route in some tests

* Fix code style (php-cs-fixer)

* Clone asset route in TSP stub

* Add cloning only the passed route

* Clone asset route in tenant asset test beforeEach

* Skip asset route cloning by default

* Fix typo

* Change public method back to protected

* Remove cloning of specific routes, skip cloning routes flagged as tenant

* Delete constructor from asset controiler, change asset method to invoke

* Update asset route registration, add prefixed asest route for path identification

* Use default middleware from config instead of `tenancy()->defaultMiddleware()`

* Delete old code from TSP stub

* Revert TSP stub change

* Revert FilesystemTenancyBootstrapper changes

* Suffix asset url in tenant_asset()

* Simplify `tenant_asset()`

* Ensure the base asset url is always suffixed with '/'

* remove unnecessary ?? false

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2023-08-31 15:44:26 +02:00
PHP CS Fixer
77b5e508d6 Fix code style (php-cs-fixer) 2022-09-29 00:47:38 +00:00
Samuel Štancl
87212e5390 phpstan, global_cache, resolver improvements, InitializationHelpers trait 2022-09-29 02:47:13 +02:00
Samuel Štancl
f941df3a82 minor improvements for phpstan 2022-09-01 19:06:54 +02:00
Samuel Štancl
8af354c20e get phpstan errors down from 252 to 189 2022-08-30 05:44:23 +02:00
stancl
6955512a6b Apply fixes from StyleCI 2020-05-22 09:01:31 +00:00
Samuel Štancl
6f4b9f486c Bootstrapper tests 2020-05-11 03:37:47 +02:00
Samuel Štancl
5e6d82be57 path identification wip 2020-05-09 03:56:41 +02:00
Samuel Štancl
a602cec940 Fix event listener tests, improve domain logic 2020-05-09 02:49:08 +02:00
Samuel Štancl
bd9aad229b vague first draft of v3. TenantModelTest is passing 2020-05-08 04:37:43 +02:00
Samuel Štancl
609b6f12cf
Remove typehints passed to route() 2019-12-06 22:34:02 +01:00
Samuel Štancl
f99ecb72c7
Don't accept closures in tenant() helper 2019-12-03 22:52:30 +01:00
Samuel Štancl
a8f84d2808 Accept closures in tenant() helper 2019-12-02 17:57:16 +01:00
Samuel Štancl
fd00be646e
[2.3.0] tenant_route() helper (#229)
* Add tenant_route helper

* Add tests

* Remove redundant setUp()

* Fix test namespaces

* Apply fixes from StyleCI
2019-11-29 00:12:07 +01:00
Samuel Štancl
d4beae32ca Add docblocks to helpers 2019-10-23 08:14:30 +02:00
Samuel Štancl
102ade4d8c optional for tenant() 2019-09-30 19:43:59 +02:00
Samuel Štancl
9d73de2840 global_cache() helper 2019-09-22 19:45:30 +02:00
Samuel Štancl
75f00a58dd Fix asset tests 2019-09-21 18:13:29 +02:00
Samuel Štancl
a34bcfbe3e Intelligent asset() 2019-09-21 16:43:03 +02:00
Samuel Štancl
6134c8113b asset() tenancy 2019-09-21 16:06:08 +02:00
Samuel Štancl
50a77ee826 Fix some tests 2019-09-16 17:36:32 +02:00
Samuel Štancl
69db512d30 Storage drivers WIP 2019-09-11 14:32:13 +02:00
Samuel Štancl
2fd3662eb7
[1.8.0] Use strict types (#115)
* Use strict types

* Apply fixes from StyleCI

* Fix str_repeat

* Fix false json decode
2019-08-23 18:18:26 +02:00
stancl
84890cdd1e Apply fixes from StyleCI 2019-08-16 16:21:59 +00:00
Samuel Štancl
fa5334f83e
Add a use statement 2019-02-13 13:23:09 +01:00
Samuel Štancl
62e3781542 Fix #30 remove namespace statement from helpers.php 2019-02-13 13:12:12 +01:00
Samuel Štancl
4ef285061a Return null if key is not found in TenantManager->tenant 2019-01-23 21:00:11 +01:00
Samuel Štancl
3a6ceed992 Fix #7 - tenant assets 2019-01-20 14:52:14 +01:00
Samuel Štancl
deb3ad77f5 Initial commit 2019-01-17 22:24:12 +01:00