Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Jun 22, 2024
1 parent f061817 commit c492a4a
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [5.1.2](https://github.com/userfrosting/framework/compare/5.1.1...5.1.2)
- Add Slim [type hinting](https://github.com/slimphp/Slim/releases/tag/4.14.0)

## [5.1.1](https://github.com/userfrosting/framework/compare/5.1.0...5.1.1)
- Fix InputArray in Fortress (See https://github.com/userfrosting/UserFrosting/issues/1251)
- Update PHPStan config
Expand Down
2 changes: 1 addition & 1 deletion src/Cache/Driver/TaggableFileStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function path($key)
$hash = $key;
$parts = [];
} else {
$parts = array_slice(str_split($hash = sha1((string) $key), 2), 0, 2);
$parts = array_slice(str_split($hash = sha1($key), 2), 0, 2);
}

return $this->directory . $this->ds . $folder . (count($parts) > 0 ? implode($this->ds, $parts) . $this->ds : '') . $hash;
Expand Down
2 changes: 2 additions & 0 deletions src/Routes/RouteDefinitionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ interface RouteDefinitionInterface
{
/**
* Register routes to the Slim App.
*
* @param App<\DI\Container> $app
*/
public function register(App $app): void;
}
4 changes: 2 additions & 2 deletions src/ServicesProvider/FrameworkService.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function register(): array
/**
* Load and register all routes.
*
* @param SlimApp $app
* @param SlimApp<\DI\Container> $app
* @param SprinkleRoutesRepository $routesRepository
*/
protected function registerRoutes(SlimApp $app, SprinkleRoutesRepository $routesRepository): void
Expand All @@ -91,7 +91,7 @@ protected function registerRoutes(SlimApp $app, SprinkleRoutesRepository $routes
* Load and register all middlewares.
* Last registered middleware is executed first.
*
* @param SlimApp $app
* @param SlimApp<\DI\Container> $app
* @param SprinkleMiddlewareRepository $middlewareRepository
*/
protected function registerMiddlewares(SlimApp $app, SprinkleMiddlewareRepository $middlewareRepository): void
Expand Down
2 changes: 2 additions & 0 deletions src/Testing/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class TestCase extends BaseTestCase

/**
* The Slim App Instance.
*
* @var App<\DI\Container>
*/
protected App $app;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function stream_open(string $path, string $mode, int $options, ?string &$
*
* @see http://php.net/manual/streamwrapper.stream-read.php
*
* @param int<0, max> $count How many bytes of data from the current position should be returned.
* @param int<1, max> $count How many bytes of data from the current position should be returned.
*
* @return string|false If there are less than count bytes available, return as many as are available. If no more data is available, return either false or an empty string.
*/
Expand Down
6 changes: 3 additions & 3 deletions src/UserFrosting.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
final class UserFrosting extends Cupcake
{
/**
* @var App The Slim application instance.
* @var App<\DI\Container> The Slim application instance.
*/
protected App $app;

/**
* Return the underlying Slim App instance, if available.
*
* @return App
* @return App<\DI\Container>
*/
public function getApp(): App
{
Expand All @@ -42,7 +42,7 @@ public function getApp(): App
*/
protected function initiateApp(): void
{
/** @var App */
/** @var App<\DI\Container> */
$app = $this->ci->get(App::class);

// Dispatch AppInitiatedEvent
Expand Down
4 changes: 2 additions & 2 deletions tests/Fortress/Transformer/RequestDataTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ public function testMultidimensionalRootLevel(): void

public function testMultidimensionalPurge(): void
{
// Schema - Use two multidimensional field : Named has a name only,
// Schema - Use two multidimensional field : Named has a name only,
// Colored has color only.
$schema = new RequestSchema([
'Named' => [],
Expand Down Expand Up @@ -506,7 +506,7 @@ public function testMultidimensionalPurge(): void
}

/**
* Same as the previous test, but 'Named' doesn't have a root field in the
* Same as the previous test, but 'Named' doesn't have a root field in the
* schema, to prove both situation are the same
*/
public function testMultidimensionalPurgeNoRoot(): void
Expand Down
3 changes: 3 additions & 0 deletions tests/TestSprinkle/TestRoutesDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

class TestRoutesDefinitions implements RouteDefinitionInterface
{
/**
* @param App<\DI\Container> $app
*/
public function register(App $app): void
{
$app->get('/foo', [TestController::class, 'index']);
Expand Down
2 changes: 1 addition & 1 deletion tests/UniformResourceLocator/BuildingLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public function testStreamWrapperReadFile(): void
$filesize = filesize($filename);
$this->assertNotFalse($filesize);

$contents = fread($handle, $filesize);
$contents = fread($handle, $filesize); // @phpstan-ignore-line

$this->assertNotEquals('', $contents);
$this->assertSame('Tesla', json_decode($contents, true)['cars'][1]['make']); // @phpstan-ignore-line
Expand Down

0 comments on commit c492a4a

Please sign in to comment.