Commit Graph

1871 Commits

Author SHA1 Message Date
Younes ENNAJI 87da42fdea Refine code style and tests 2026-03-01 20:16:44 +00:00
Younes ENNAJI 4d9cda22cf build assets 2026-03-01 20:16:00 +00:00
Younes ENNAJI c58f3c7b40 upgrade dependencies 2026-03-01 20:15:46 +00:00
Younes ENNAJI 47eb66e874 fix: update tests for new validation requirements
Update tests that were using invalid values for HopsStamp (0 is now
invalid, must be >= 1) and update expected output format for
mainScript (now uses json_encode which produces double quotes).
2026-03-01 20:13:57 +00:00
Younes ENNAJI 30de24f054 fix: add null checks and error handling to docs JS controllers
clipboard_controller.js:
- Check if clipboard API is available before using
- Handle clipboard write promise rejection
- Show error icon on failure

prev-next_controller.js:
- Guard against missing navigation element
- Guard against missing span element in links

anchor_controller.js:
- Guard against missing ul element
2026-03-01 20:11:07 +00:00
Younes ENNAJI 162ea87330 fix: prevent memory leaks and handle errors in FlasherPlugin
- Remove DOMContentLoaded listener after it fires to prevent memory leak
- Clean up timer interval and event listeners when notification is removed
- Add null check in stringToHTML to throw clear error for invalid templates
- Store cleanup function on notification element for proper disposal

Added tests for memory leak prevention and error handling.
2026-03-01 20:10:06 +00:00
Younes ENNAJI 8cda9d1eb1 fix: rename shadowed variable in Request::getType()
The parameter \$type was being reassigned to the session value, which
shadows the original parameter and causes confusion for static analysis
tools and maintainers.

Renamed the session value variable to \$value for clarity.
2026-03-01 20:08:28 +00:00
Younes ENNAJI 6d314dbc07 fix: add validation to HopsStamp and DelayStamp
HopsStamp:
- Validate hops amount must be >= 1 (positive integer)
- Negative or zero hops don't make logical sense

DelayStamp:
- Validate delay must be >= 0 (non-negative integer)
- Negative delays don't make logical sense

Both now throw InvalidArgumentException for invalid values, making
configuration errors fail fast with clear messages.
2026-03-01 20:07:54 +00:00
Younes ENNAJI ad5c0f56dd fix: validate limit criteria must be positive integer
Previously, negative limits caused array_slice() to return unexpected
results (all except last N elements) and zero returned an empty array
without clear intent.

Now throws InvalidArgumentException for values < 1, making invalid
configurations fail fast with a clear error message.
2026-03-01 20:06:53 +00:00
Younes ENNAJI fd36c2ec0c fix: validate alias attribute in PresenterCompilerPass
Add validation to ensure services tagged with 'flasher.presenter' have
the required 'alias' attribute. Previously, accessing $attributes['alias']
without checking would throw an "Undefined array key" error.

Now throws a clear InvalidArgumentException with a helpful message.
2026-03-01 20:01:12 +00:00
Younes ENNAJI 5202c86107 fix: handle invalid JSON gracefully in FlasherComponent
The json_decode() with JSON_THROW_ON_ERROR throws an exception before
the ?: operator can provide a fallback value. This caused page crashes
when invalid JSON was passed to the Blade component attributes.

Now using a helper method with try-catch to safely decode JSON and
return an empty array on failure, preventing page crashes.
2026-03-01 20:00:16 +00:00
Younes ENNAJI 9e7bb17faa fix: make OctaneListener invokable for Laravel event dispatcher
Laravel's event dispatcher expects listener classes to be invokable
(have __invoke method) when registered as a class name string.

The OctaneListener was using a handle() method which caused the
listener to never be invoked, resulting in notification state leaking
between Octane requests.

Renamed handle() to __invoke() to fix the issue.
2026-03-01 19:59:25 +00:00
Younes ENNAJI 83dc9e49dc fix: handle null public directory gracefully in InstallCommand
The getPublicDir() method can return null, but the code was directly
concatenating it with a string, which could cause unexpected behavior.

Now the command properly checks for null and returns a failure with
a clear error message instead of proceeding with an invalid path.
2026-03-01 19:57:50 +00:00
Younes ENNAJI 1d81de581b fix: escape nonce and mainScript to prevent XSS vulnerabilities
The HtmlPresenter was interpolating user-controlled values directly into
HTML attributes and JavaScript code without proper escaping, creating
XSS vulnerabilities.

Changes:
- Escape nonce with htmlspecialchars() for HTML attribute context
- Escape nonce with json_encode() for JavaScript string context
- Escape mainScript with json_encode() for JavaScript string context

Added tests to verify XSS payloads are properly escaped.
2026-03-01 19:55:49 +00:00
Younes ENNAJI 2ebdbecda6 fix: correct inverted Livewire registration condition
The condition in registerLivewire() was inverted, causing the Livewire
listener to never be registered when Livewire was actually available.

Before: returned early when Livewire class exists AND is NOT bound
After: returns early when Livewire class does NOT exist OR is NOT bound

This fixes Livewire notifications not being displayed in Livewire components.
2026-03-01 19:53:39 +00:00
Younes ENNAJI 851e0a00ed improve Translator test coverage to 100% 2026-02-26 06:13:13 +00:00
Younes ENNAJI d9b0b6998e add tests for FlasherDataCollector 2026-02-26 06:04:11 +00:00
Younes ENNAJI ed992d78f6 add tests for FlasherAssert and Constraint classes 2026-02-25 20:45:32 +00:00
Younes ENNAJI 0612a3bb61 exclude .phpstorm.meta.php from coverage 2026-02-25 20:35:27 +00:00
Younes ENNAJI c9a61ba69c add tests for helper functions 2026-02-25 20:29:51 +00:00
Younes ENNAJI f9746f607b add Laravel Facade tests 2026-02-25 20:22:38 +00:00
Younes ENNAJI 18c2233baa add tests for remaining Criteria classes 2026-02-25 20:01:29 +00:00
Younes ENNAJI 08c242b45a fix test to properly suppress expected console error 2026-02-25 19:50:01 +00:00
Younes ENNAJI cd53ceb139 improve test coverage for edge cases 2026-02-25 19:31:21 +00:00
Younes ENNAJI 549c36eeee improve test coverage for PHPUnit and Vitest 2026-02-25 19:16:53 +00:00
Younes ENNAJI ea0dccc961 add test coverage for PHPUnit and Vitest 2026-02-25 15:58:13 +00:00
Younes ENNAJI d33de77835 add vitest for JS/TS testing with comprehensive test coverage 2026-02-25 15:52:21 +00:00
Younes ENNAJI 62848e0fd1 update composer.lock 2026-02-25 11:37:47 +00:00
Younes ENNAJI c5059adac7 fix PHPStan errors in ThemeTemplatesTest 2026-02-25 11:34:09 +00:00
Younes ENNAJI 4145b870dd fix PHPStan errors in SessionBag 2026-02-25 11:34:01 +00:00
Younes ENNAJI 18a31f578b use PHP 8.2 for lint task 2026-02-25 11:33:40 +00:00
Younes ENNAJI f20bdebda0 add bootstrap and tailwindcss theme templates for Laravel 2026-02-25 11:20:29 +00:00
Younes ENNAJI f9807e91e2 add FallbackSession for stateless requests in Laravel 2026-02-25 11:15:34 +00:00
Younes ENNAJI e35339dca9 fix typo in FilterCriteria error message 2026-02-25 11:00:32 +00:00
Younes ENNAJI f9bef40ae6 fix misleading error messages in HopsCriteria and DelayCriteria 2026-02-25 10:43:52 +00:00
Younes ENNAJI 670e40dc97 fix StampsCriteria comparing values instead of keys 2026-02-25 10:43:44 +00:00
Younes ENNAJI 2b0e736d28 fix multi-field sorting in OrderByCriteria 2026-02-25 10:43:36 +00:00
Younes ENNAJI b79902779e add support for Laravel v13 2026-02-25 10:26:04 +00:00
Younes ENNAJI 8779de6c62 upgrade dependencies 2026-02-25 10:18:29 +00:00
Younes ENNAJI c074feea05 Apply clean design to Inertia docs and remove Additional Features section
- Removed emerald-colored icons from table of contents navigation
- Removed gradient backgrounds from section headers
- Simplified version requirement cards
- Updated all callout boxes to use slate-50 background
- Updated tabs to use indigo colors instead of emerald
- Removed Additional Features section from Advanced section
2026-01-25 06:32:49 +01:00
Younes ENNAJI 033d650497 Redesign Laravel, Symfony, and Livewire documentation pages
- Simplify table of contents navigation (remove colored icons)
- Remove gradient backgrounds from section headers
- Simplify version requirement cards (remove gradients and accent lines)
- Update callout boxes to use consistent slate-50 background
- Simplify notification type cards (remove gradient backgrounds)
- Use uniform slate/indigo color scheme throughout
2026-01-25 06:23:15 +01:00
Younes ENNAJI 913f7b9d17 Updates assets due to code changes 2026-01-25 06:20:13 +01:00
Younes ENNAJI 9eb6dcf8fa Redesign Symfony page with clean, professional styling
- Simplify table of contents navigation (remove colored icons)
- Remove gradient backgrounds from section headers
- Simplify version requirement cards (remove gradients and accent lines)
- Update callout boxes to use consistent slate-50 background
- Simplify notification type cards (remove gradient backgrounds)
- Use uniform slate/indigo color scheme throughout
- Fix malformed HTML in code blocks
- Update notification example to match callout style
2026-01-25 06:14:41 +01:00
Younes ENNAJI 06f75b21eb Fix jQuery dependency for Toastr library
Import jQuery and make it globally available before Toastr is loaded.
This prevents console errors about jQuery not being found.
2026-01-25 06:03:39 +01:00
Younes ENNAJI 0fe2e3e38e Change Themes badge from 'soon' to 'NEW' 2026-01-25 05:57:42 +01:00
Younes ENNAJI 3ee5ba2909 Change footer 'Created By' to 'Author' 2026-01-25 05:56:06 +01:00
Younes ENNAJI ca1a38d282 Simplify footer design with clean slate color scheme
- Remove gradient background and decorative SVG wave
- Use consistent slate-900/400/500 color palette
- Remove animated elements and decorative bars
- Simplify social links and documentation navigation
- Reduce author image size for cleaner layout
2026-01-25 05:54:42 +01:00
Younes ENNAJI 917b2c8f06 Simplify color scheme in Features and Libraries sections
- Replace vibrant gradient cards with clean white cards
- Use consistent indigo/slate color palette throughout
- Remove multicolor gradients for a more professional look
- All icons now use indigo-600 on indigo-50 backgrounds
- Stats section now uses uniform indigo color
- CTA button simplified to single indigo color
2026-01-25 05:51:18 +01:00
Younes ENNAJI 80cf92af09 Redesign "Choose Your Preferred Library" section with modern compact cards
- Simplify card design with centered layout
- Remove long descriptions in favor of concise taglines
- Use gradient icon badges with rounded squares
- Improve CTA button with gradient styling
- Reduce vertical space while maintaining visual appeal
2026-01-25 05:47:35 +01:00
Younes ENNAJI 82d0bc5a26 Redesign "Why Choose PHPFlasher?" section with modern gradient cards
- Replace white cards with vibrant gradient backgrounds
- Simplify content with concise descriptions
- Add decorative circles and backdrop blur effects
- Add stats section with key metrics (6+ frameworks, 5+ libraries, 10+ themes, 100% TypeScript)
- Improve visual hierarchy and spacing
2026-01-25 05:45:29 +01:00