ParameterSpecInterface::getDefaultValue()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of the pinepain/js-sandbox PHP library.
5
 *
6
 * Copyright (c) 2016-2017 Bogdan Padalko <[email protected]>
7
 *
8
 * Licensed under the MIT license: http://opensource.org/licenses/MIT
9
 *
10
 * For the full copyright and license information, please view the
11
 * LICENSE file that was distributed with this source or visit
12
 * http://opensource.org/licenses/MIT
13
 */
14
15
16
namespace Pinepain\JsSandbox\Specs\Parameters;
17
18
19
use Pinepain\JsSandbox\Extractors\Definition\ExtractorDefinitionInterface;
20
21
22
// don't do full args validation, just necessary minimum for converting from JS to PHP
23
interface ParameterSpecInterface
24
{
25
    public function getExtractorDefinition(): ExtractorDefinitionInterface;
26
27
    public function getName(): string; // We may use it later to generate function description
28
29
    public function isOptional(): bool; // when undefined passed we may use optional value, if it available
30
31
    // TODO:  to generate js function toString() text we may keep this value compatible with default arg standard
32
    public function getDefaultValue(); // if variadic, [] is default, every variadic is optional.
33
34
    public function isVariadic(): bool;
35
//
0 ignored issues
show
Unused Code Comprehensibility introduced by
47% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
36
//    public function isVirtual() : bool; // TODO: virtual parameter will simply return what user set via $this->getDefaultValue()
37
}
38