Skip to content

PhpDoc for return type for class constructors should be the class type. #702

@comanche

Description

@comanche

PhpDoc for return type for class constructors should be the class type that's is being instantiated.

Example: return type for Blueprint's constructor should be Blueprint instead of void.
File: vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php

<?php namespace Illuminate\Database\Schema;

use Closure;
use Illuminate\Support\Fluent;
use Illuminate\Database\Connection;
use Illuminate\Database\Schema\Grammars\Grammar;

class Blueprint {

    /**
     * Create a new schema blueprint.
     *
     * @param  string   $table
     * @param  Closure  $callback
     * @return Blueprint (this was previously void)
     */
    public function __construct($table, Closure $callback = null)
    {
        $this->table = $table;

        if ( ! is_null($callback)) $callback($this);
    }
    //...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions