Giter Site home page Giter Site logo

phalcon / ide-stubs Goto Github PK

View Code? Open in Web Editor NEW
159.0 18.0 50.0 2.34 MB

Phalcon IDE Stubs

Home Page: https://phalcon.io

License: Other

PHP 100.00%
phalcon devtools ide stubs autocomplete autocompletion php syntax-highlighting ide-helper phpstorm

ide-stubs's Introduction

Phalcon IDE Stubs

This repo provides the most complete Phalcon Framework stubs which enables autocompletion in modern IDEs.

Installing via Composer

composer require --dev phalcon/ide-stubs

Installing via Git

  1. Clone the Phalcon IDE Stubs repository in a common location.
  2. Setup your IDE.

Read before create PR with fix

All stubs are generated from cphalcon project via Zephir stubs.
Please find the problem inside Phalcon's Zephir code and submit pull request with fix here.

How to update stubs

  1. Generate stubs inside cphalcon project
php zephir.phar fullclean
php zephir.phar generate
php zephir.phar stubs
  1. Replace .zep inside generated .php files
find ide/ -type f -exec rename 's/\.zep//' '{}' \;
  1. Mass fix code style
# Pick latest .phar from here: https://github.com/squizlabs/PHP_CodeSniffer/releases
php phpcbf.phar --standard=PSR12 src
  1. Copy all files from ide/%version%/Phalcon/ folder in cphalcon project
  2. Paste inside src/ folder in ide-stubs project

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

License

Phalcon IDE Stubs is open-sourced software licensed under the New BSD License. ยฉ Phalcon Framework Team and contributors.

ide-stubs's People

Contributors

anantadwi13 avatar angelxmoreno avatar arhell avatar drummi42 avatar elcreator avatar fagai avatar fesiong avatar hopeseekr avatar ivastly avatar jeckerson avatar joilson avatar kevcomparadise avatar lisi4ok avatar naoyukik avatar niden avatar pengpixel avatar ruudboon avatar sergeyklay avatar shucream0117 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ide-stubs's Issues

MethodSignatureMismatch AbstractValidator::getOption has wrong type 'mixed', expecting 'string'

ERROR: MethodSignatureMismatch - src/Common/Validation/IsBool.php:11:7 - Argument 1 of Phalcon\Validation\AbstractValidator::getOption has wrong type 'mixed', expecting 'string' as defined by Phalcon\Validation\ValidatorInterface::getOption (see https://psalm.dev/042)

Not sure if this can be changed in the repo or if phalcon itself allows a mixed type here. For now suppressing the error.

[NFR] Replace PHPDocs in ext/ with those generated by `zephir stubs`

From @SidRoberts on October 3, 2016 20:41

Using this method as an example:

/**
 * Checks if a password hash is a valid bcrypt's hash
 */
public function isLegacyHash(string passwordHash) -> boolean
{
    // ...
}

Instead of producing:

/**
 * Checks if a password hash is a valid bcrypt's hash
 */
PHP_METHOD(Phalcon_Security, isLegacyHash) {

    // ...

}

Instead, it should be:

/**
 * Checks if a password hash is a valid bcrypt's hash
 *
 * @param string passwordHash
 *
 * @return boolean
 */
PHP_METHOD(Phalcon_Security, isLegacyHash) {

    // ...

}

Copied from original issue: zephir-lang/zephir#1335

phpDoc @method from src/Html/TagFactory.php

Hello guys =)

The methods you define in the class TagFactory (to access methods from $this->tag->*) are 'badly' written, and auto-completion doesn't work.
You guys probably miswrited, same implementation from src/Support/HelperFactory works perfectly =)

See you and great work so far on the v5 o/

V4: \Phalcon\Mvc\Model::find() - wrong return namespace

phalcon source: https://github.com/phalcon/cphalcon/blob/master/phalcon/Mvc/Model.zep:

use Phalcon\Mvc\Model\ResultsetInterface;
public static function find(var parameters = null) -> <ResultsetInterface>

ide-stubs source: https://github.com/phalcon/ide-stubs/blob/4.x/src/Phalcon/mvc/Model.php:

namespace Phalcon\Mvc;
public static function find($parameters = null): ResultsetInterface {}

ResultsetInterface - has wrong namespace: \Phalcon\Mvc\ResultsetInterface
correct: \Phalcon\Mvc\Model\ResultsetInterface

Automatize stubs code generation for new release

Make automatic PR creation with latest stubs code.

+/- steps are:

  1. Trigger PR creation when Create Release in Phalcon CI finished with success
  2. Execute necessary commands to generate stubs from its release
  3. Create branch with exact name and create PR pointing to the master

3.3.1 & 3.3.2 stubs

Again, may I ask you to add stubs for those releases?
Maybe you should think about including this step in your release process? ๐Ÿ˜„

Wrong return type for Phalcon\Http\Request::getUploadedFiles

Hello !

PHPDoc of Phalcon\Http\Request::getUploadedFiles says the method returns array|\Phalcon\Http\Request\FileInterface[] which is confusing because its either an array of unknown values or an array of FileInterface.

The method returns only FileInterface objects, so it should @return \Phalcon\Http\Request\FileInterface[] :)

Phalcon 5 alpha

๐Ÿ‘‹

Phalcon 5 alpha is out in the wild and ready for brave use with PHP 8.
But there aren't any IDE stubs published here.

Intentional?

Use phalcon with eval(a) or reflection, so the development environment does not throw error messages

Hi there

My eclipse always says "The import Phalcon ... cannot be resolved" and "PhalconClass cannot be resolved to a type" and so on...

I think there is no other "solution" than to disable that kind of warnings, error messages, whatever. But the problem is that other classes, they are REALLY missing, will also not shown anymore.

And i also think it's COMPLETELY IMPOSSIBLE to avoid that problem - because phalcon has, as a php extension, no php classes they may be resolved.

So my idea: To use the eval() method or reflection to bypass that issue?

What do you think about? Is that a good idea or not? Maybe there are other (better?) solutions for it?

Thank you for your feedbacks.

Best regards,
Jan

Incorrect stub generation

From @sergeyklay on November 25, 2015 21:31

Phalcon 2.0.9
Phalcon\Session\AdapterInterface

    /**
     * Sets session options
     */
    public function setOptions(array! options);

used zephir stubs

Expected

    /**
     * Sets session options
     */
    public function setOptions(array $options);

Actual

    /**
     * Sets session options
     *
     * @param array $options 
     */
    public function setOptions($options);

Copied from original issue: zephir-lang/zephir#1132

Method signature mismatch

MethodSignatureMismatch - Argument 1 of Phalcon\Annotations\Adapter\AbstractAdapter::get has wrong type 'mixed', expecting 'string' as defined by Phalcon\Annotations\Adapter\AdapterInterface::get (see https://psalm.dev/042)

Return Route, not RouteInterface in Phalcon\Mvc\Router\Group::add

I'm bundling ide-stubs project in a plugins project and distributing as a PhpStorm plugin. (Still haven't gotten around to automate that yet, but will soon ๐Ÿ™‚ ) a user reported that Phalcon\Mvc\Router\Group::add doesn't return the correct data.

The PHPDoc for \Phalcon\Mvc\Router\Group::add states, that add() on a group would return an instance of Phalcon\Mvc\RouteInterface but it really returns an instance of Phalcon\Mvc\Route

This results in PHPStorm not finding the convert() method on a group object.

Here's the issue fossapps/PhpStorm-Phalcon-Autocomplete#3 which he created you can follow

Configure Visual Studio Code

Hey,

I can't configure Visual Studio Code IDE for adding the ide-stubs to his path.

Is there somebody who success to do this?

Thanks.

Ide plugin

Hi there,
from last time I had a chat with maintainers, I created IDE plugins for PHP storm and seems a lot of people are using it apparently,

But I've moved on from PHP and don't want others to miss out on this, my automation is going well, but still have to manually update the IDE plugin (I actually forgot last few releases)

fossapps/PhpStorm-Phalcon-Autocomplete#7 I've created this issue, so if someone's willing to give this a try, I won't have to do anything to that project anymore :)

Tag?

Hi!

Can you tag stubs by phalcon version? (old releases)

Cheers!

Phalcon\Di\Injectable::setDI has wrong type 'mixed'

Phalcon 4.0.5
DevTools 4.0.3
Stubs 4.0.4
PHP 7.4.x

Running psalm vendor/bin/psalm results in several variations of the errors below:

INFO: MethodSignatureMismatch - MyModel.php:12:7 - 
Argument 1 of Phalcon\Di\AbstractInjectionAware::setDI has wrong type 'mixed', expecting 'Phalcon\Di\DiInterface' as defined by Phalcon\Di\InjectionAwareInterface::setDI (see https://psalm.dev/042)
class MyModel extends Model
INFO: MethodSignatureMismatch - Validator.php:11:7 - 
Argument 1 of Phalcon\Di\Injectable::setDI has wrong type 'mixed', expecting 'Phalcon\Di\DiInterface' as defined by Phalcon\Di\InjectionAwareInterface::setDI (see https://psalm.dev/042)
class Validator extends Validation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.