Skip to content

Commit d817dac

Browse files
author
larry.sulebalogun
committed
10 - Add updated phpstan rule set
1 parent 5d52798 commit d817dac

File tree

1 file changed

+51
-87
lines changed

1 file changed

+51
-87
lines changed

phpstan-baseline.neon

Lines changed: 51 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -367,62 +367,26 @@ parameters:
367367
path: examples/08-schema-showcase-streamable/server.php
368368

369369
-
370-
message: '#^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\CallToolHandler constructor expects Mcp\\Capability\\Registry, Mcp\\Capability\\ToolChain given\.$#'
370+
message: '#^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\ListPromptsHandler constructor expects Mcp\\Capability\\Registry\\ReferenceProviderInterface, Mcp\\Capability\\PromptChain given\.$#'
371371
identifier: argument.type
372372
count: 1
373373
path: examples/09-standalone-cli/src/Builder.php
374374

375375
-
376-
message: '#^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\GetPromptHandler constructor expects Mcp\\Capability\\Registry, Mcp\\Capability\\PromptChain given\.$#'
376+
message: '#^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\ListResourcesHandler constructor expects Mcp\\Capability\\Registry\\ReferenceProviderInterface, Mcp\\Capability\\ResourceChain given\.$#'
377377
identifier: argument.type
378378
count: 1
379379
path: examples/09-standalone-cli/src/Builder.php
380380

381381
-
382-
message: '#^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\ListPromptsHandler constructor expects Mcp\\Capability\\Registry, Mcp\\Capability\\PromptChain given\.$#'
382+
message: '#^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\ListToolsHandler constructor expects Mcp\\Capability\\Registry\\ReferenceProviderInterface, Mcp\\Capability\\ToolChain given\.$#'
383383
identifier: argument.type
384384
count: 1
385385
path: examples/09-standalone-cli/src/Builder.php
386386

387387
-
388-
message: '#^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\ListResourcesHandler constructor expects Mcp\\Capability\\Registry, Mcp\\Capability\\ResourceChain given\.$#'
389-
identifier: argument.type
390-
count: 1
391-
path: examples/09-standalone-cli/src/Builder.php
392-
393-
-
394-
message: '#^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\ListToolsHandler constructor expects Mcp\\Capability\\Registry, Mcp\\Capability\\ToolChain given\.$#'
395-
identifier: argument.type
396-
count: 1
397-
path: examples/09-standalone-cli/src/Builder.php
398-
399-
-
400-
message: '#^Parameter \#1 \$registry of class Mcp\\Server\\RequestHandler\\ReadResourceHandler constructor expects Mcp\\Capability\\Registry, Mcp\\Capability\\ResourceChain given\.$#'
401-
identifier: argument.type
402-
count: 1
403-
path: examples/09-standalone-cli/src/Builder.php
404-
405-
-
406-
message: '#^Call to protected method formatResult\(\) of class Mcp\\Capability\\Registry\\ResourceReference\.$#'
407-
identifier: method.protected
408-
count: 1
409-
path: src/Capability/Registry.php
410-
411-
-
412-
message: '#^Cannot import type alias CallableArray\: type alias does not exist in Mcp\\Capability\\Registry\\ElementReference\.$#'
413-
identifier: typeAlias.notFound
414-
count: 1
415-
path: src/Capability/Registry.php
416-
417-
-
418-
message: '#^Method Mcp\\Capability\\Registry\:\:handleCallTool\(\) has parameter \$arguments with no value type specified in iterable type array\.$#'
419-
identifier: missingType.iterableValue
420-
count: 1
421-
path: src/Capability/Registry.php
422-
423-
-
424-
message: '#^Method Mcp\\Capability\\Registry\:\:handleCallTool\(\) return type has no value type specified in iterable type array\.$#'
425-
identifier: missingType.iterableValue
388+
message: '#^Access to an undefined property Mcp\\Capability\\Registry\:\:\$referenceHandler\.$#'
389+
identifier: property.notFound
426390
count: 1
427391
path: src/Capability/Registry.php
428392

@@ -433,76 +397,52 @@ parameters:
433397
path: src/Capability/Registry.php
434398

435399
-
436-
message: '#^Method Mcp\\Capability\\Registry\:\:registerPrompt\(\) has parameter \$handler with no value type specified in iterable type array\.$#'
437-
identifier: missingType.iterableValue
438-
count: 1
439-
path: src/Capability/Registry.php
440-
441-
-
442-
message: '#^Method Mcp\\Capability\\Registry\:\:registerResource\(\) has parameter \$handler with no value type specified in iterable type array\.$#'
443-
identifier: missingType.iterableValue
444-
count: 1
445-
path: src/Capability/Registry.php
446-
447-
-
448-
message: '#^Method Mcp\\Capability\\Registry\:\:registerResourceTemplate\(\) has parameter \$handler with no value type specified in iterable type array\.$#'
449-
identifier: missingType.iterableValue
450-
count: 1
451-
path: src/Capability/Registry.php
452-
453-
-
454-
message: '#^Method Mcp\\Capability\\Registry\:\:registerTool\(\) has parameter \$handler with no value type specified in iterable type array\.$#'
455-
identifier: missingType.iterableValue
400+
message: '#^Return type \(list\<Mcp\\Schema\\Resource\>\) of method Mcp\\Capability\\Registry\:\:getResources\(\) should be compatible with return type \(list\<resource\>\) of method Mcp\\Capability\\Registry\\ReferenceProviderInterface\:\:getResources\(\)$#'
401+
identifier: method.childReturnType
456402
count: 1
457403
path: src/Capability/Registry.php
458404

459405
-
460-
message: '#^PHPDoc tag @param for parameter \$handler with type \(callable\)\|Mcp\\Capability\\CallableArray\|string is not subtype of native type array\|\(callable\)\|string\.$#'
461-
identifier: parameter.phpDocType
462-
count: 4
463-
path: src/Capability/Registry.php
464-
465-
-
466-
message: '#^Parameter \$handler of method Mcp\\Capability\\Registry\:\:registerPrompt\(\) has invalid type Mcp\\Capability\\CallableArray\.$#'
467-
identifier: class.notFound
406+
message: '#^Call to an undefined method Mcp\\Capability\\Registry\\ResourceTemplateReference\:\:handle\(\)\.$#'
407+
identifier: method.notFound
468408
count: 1
469-
path: src/Capability/Registry.php
409+
path: src/Capability/Registry/ResourceTemplateReference.php
470410

471411
-
472-
message: '#^Parameter \$handler of method Mcp\\Capability\\Registry\:\:registerResource\(\) has invalid type Mcp\\Capability\\CallableArray\.$#'
473-
identifier: class.notFound
412+
message: '#^PHPDoc tag @return with type array is incompatible with native type object\.$#'
413+
identifier: return.phpDocType
474414
count: 1
475-
path: src/Capability/Registry.php
415+
path: src/Schema/Result/EmptyResult.php
476416

477417
-
478-
message: '#^Parameter \$handler of method Mcp\\Capability\\Registry\:\:registerResourceTemplate\(\) has invalid type Mcp\\Capability\\CallableArray\.$#'
479-
identifier: class.notFound
418+
message: '#^Method Mcp\\Schema\\Result\\ReadResourceResult\:\:jsonSerialize\(\) should return array\{contents\: array\<Mcp\\Schema\\Content\\BlobResourceContents\|Mcp\\Schema\\Content\\TextResourceContents\>\} but returns array\{contents\: array\<Mcp\\Schema\\Content\\ResourceContents\>\}\.$#'
419+
identifier: return.type
480420
count: 1
481-
path: src/Capability/Registry.php
421+
path: src/Schema/Result/ReadResourceResult.php
482422

483423
-
484-
message: '#^Parameter \$handler of method Mcp\\Capability\\Registry\:\:registerTool\(\) has invalid type Mcp\\Capability\\CallableArray\.$#'
485-
identifier: class.notFound
424+
message: '#^Call to an undefined method Mcp\\Capability\\Registry\\ReferenceProviderInterface\:\:calculateNextCursor\(\)\.$#'
425+
identifier: method.notFound
486426
count: 1
487-
path: src/Capability/Registry.php
427+
path: src/Server/RequestHandler/ListPromptsHandler.php
488428

489429
-
490-
message: '#^Call to an undefined method Mcp\\Capability\\Registry\\ResourceTemplateReference\:\:handle\(\)\.$#'
430+
message: '#^Call to an undefined method Mcp\\Capability\\Registry\\ReferenceProviderInterface\:\:calculateNextCursor\(\)\.$#'
491431
identifier: method.notFound
492432
count: 1
493-
path: src/Capability/Registry/ResourceTemplateReference.php
433+
path: src/Server/RequestHandler/ListResourcesHandler.php
494434

495435
-
496-
message: '#^PHPDoc tag @return with type array is incompatible with native type object\.$#'
497-
identifier: return.phpDocType
436+
message: '#^Parameter \#1 \$resources of class Mcp\\Schema\\Result\\ListResourcesResult constructor expects array\<Mcp\\Schema\\Resource\>, list\<resource\> given\.$#'
437+
identifier: argument.type
498438
count: 1
499-
path: src/Schema/Result/EmptyResult.php
439+
path: src/Server/RequestHandler/ListResourcesHandler.php
500440

501441
-
502-
message: '#^Method Mcp\\Schema\\Result\\ReadResourceResult\:\:jsonSerialize\(\) should return array\{contents\: array\<Mcp\\Schema\\Content\\BlobResourceContents\|Mcp\\Schema\\Content\\TextResourceContents\>\} but returns array\{contents\: array\<Mcp\\Schema\\Content\\ResourceContents\>\}\.$#'
503-
identifier: return.type
442+
message: '#^Call to an undefined method Mcp\\Capability\\Registry\\ReferenceProviderInterface\:\:calculateNextCursor\(\)\.$#'
443+
identifier: method.notFound
504444
count: 1
505-
path: src/Schema/Result/ReadResourceResult.php
445+
path: src/Server/RequestHandler/ListToolsHandler.php
506446

507447
-
508448
message: '#^Method Mcp\\Server\\ServerBuilder\:\:getCompletionProviders\(\) return type has no value type specified in iterable type array\.$#'
@@ -641,3 +581,27 @@ parameters:
641581
identifier: property.onlyWritten
642582
count: 1
643583
path: src/Server/ServerBuilder.php
584+
585+
-
586+
message: '#^Offset ''prompt1'' does not exist on list\<Mcp\\Schema\\Prompt\>\.$#'
587+
identifier: offsetAccess.notFound
588+
count: 1
589+
path: tests/Capability/Registry/RegistryProviderTest.php
590+
591+
-
592+
message: '#^Offset ''test1\://\{id\}'' does not exist on list\<Mcp\\Schema\\ResourceTemplate\>\.$#'
593+
identifier: offsetAccess.notFound
594+
count: 1
595+
path: tests/Capability/Registry/RegistryProviderTest.php
596+
597+
-
598+
message: '#^Offset ''test\://resource1'' does not exist on list\<Mcp\\Schema\\Resource\>\.$#'
599+
identifier: offsetAccess.notFound
600+
count: 1
601+
path: tests/Capability/Registry/RegistryProviderTest.php
602+
603+
-
604+
message: '#^Offset ''tool1'' does not exist on list\<Mcp\\Schema\\Tool\>\.$#'
605+
identifier: offsetAccess.notFound
606+
count: 1
607+
path: tests/Capability/Registry/RegistryProviderTest.php

0 commit comments

Comments
 (0)