Skip to content

Commit

Permalink
php stan
Browse files Browse the repository at this point in the history
  • Loading branch information
Riley19280 committed Aug 11, 2023
1 parent a6ce757 commit d2dc8e3
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 22 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"spatie/invade": "^2.0",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^7",
"nunomaduro/larastan": "^2.0.1",
"pestphp/pest": "^2.9",
"pestphp/pest-plugin-arch": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0"
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan": "^1.10"
},
"license": "MIT",
"autoload": {
Expand Down
11 changes: 2 additions & 9 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,12 @@ const config = {
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'riley19280', // Usually your GitHub org/user name.
projectName: 'code-stencil', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
Expand All @@ -39,8 +34,6 @@ const config = {
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/riley19280/code-stencil/tree/main/docs/docs/',
},
Expand All @@ -65,9 +58,9 @@ const config = {
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
sidebarId: 'walkthroughSidebar',
position: 'left',
label: 'Tutorial',
label: 'Walkthrough',
},
{
href: 'https://github.com/riley19280/code-stencil',
Expand Down
2 changes: 1 addition & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
walkthroughSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
Expand Down
Empty file removed phpstan-baseline.neon
Empty file.
4 changes: 0 additions & 4 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
includes:
- phpstan-baseline.neon

parameters:
level: 4
paths:
- src
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false
10 changes: 5 additions & 5 deletions src/CodeStencilHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function wrapUsing(string $open, string $close, callable $callable, ...$a
* @param callable(static $stencil, mixed ...$args): mixed $callable
* @param ...$args
*
* @return $this
* @return static
*/
public function parenStatement(string $statement, callable $callable, ...$args): static
{
Expand All @@ -146,7 +146,7 @@ public function parenStatement(string $statement, callable $callable, ...$args):
* @param callable(static $stencil, mixed ...$args): mixed $callable
* @param ...$args
*
* @return $this
* @return static
*/
public function squareStatement(string $statement, callable $callable, ...$args): static
{
Expand All @@ -161,7 +161,7 @@ public function squareStatement(string $statement, callable $callable, ...$args)
* @param callable(static $stencil, mixed ...$args): mixed $callable
* @param ...$args
*
* @return $this
* @return static
*/
public function curlyStatement(string $statement, callable $callable, ...$args): static
{
Expand All @@ -176,7 +176,7 @@ public function curlyStatement(string $statement, callable $callable, ...$args):
* @param callable(static $stencil, mixed ...$args): mixed $callable
* @param ...$args
*
* @return $this
* @return static
*/
public function angleStatement(string $statement, callable $callable, ...$args): static
{
Expand All @@ -191,7 +191,7 @@ public function angleStatement(string $statement, callable $callable, ...$args):
* @param callable(static $stencil, mixed ...$args): mixed $callable
* @param ...$args
*
* @return $this
* @return static
*/
public function angleClosedStatement(string $statement, callable $callable, ...$args): static
{
Expand Down
1 change: 1 addition & 0 deletions src/LaravelStringHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ protected function registerLaravelStringFunctions(): void

protected function getLaravelStringMethods(): array
{
// @phpstan-ignore-next-line
return array_filter(get_class_methods(new \Illuminate\Support\Str()), function($method) {
return !str_starts_with($method, '__') &&
!str_starts_with($method, 'when') &&
Expand Down
3 changes: 2 additions & 1 deletion src/Stencil.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ public function spacesPerIndent(int $spaces = 4): static
* @param string|callable(static $stencil, mixed ...$args): mixed $code
* @param int $indentLevel
*
* @return $this
* @return static
*/
public function indented(string|callable $code, int $indentLevel = 1): static
{
// @phpstan-ignore-next-line
return $this
->indent($indentLevel)
->when(is_string($code), fn(self $s) => $s->line($code), fn(self $s) => $s->call($code))
Expand Down

0 comments on commit d2dc8e3

Please sign in to comment.