Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Generate path for FlexEntity and class_alias #6

Closed
wants to merge 8 commits into from
Closed

Generate path for FlexEntity and class_alias #6

wants to merge 8 commits into from

Conversation

thehawk970
Copy link

No description provided.

break;

case 'd':
$porcelaine = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

porcelain, not porcelaine, and it's not that, it's dryRun. porcelain is different :-).

@Hywan
Copy link
Member

Hywan commented Feb 11, 2015

@camael24 Could you provide a description and an example of use please? Also, I am not certain to be the one to evaluate this PR. Do you know someone else who could do a peer-review?

@thehawk970
Copy link
Author

@Hywan thanks to the review, i will apply those modification (not sure "ces modifications") tomorrow, today I too budy

The PR its to help the class_alias resolution in destination to our IDE, we juste need to include the generated file in exemple /tmp/foo.php in the IDE.

An output exemple file is :

<?php 
namespace Hoa\Console {
class Readline extends \Hoa\Console\Readline\Readline {}
}
namespace Hoa\Console\Readline {
class Autocompleter extends \Hoa\Console\Readline\Autocompleter\Autocompleter {}
}
namespace Hoa {
class Console extends \Hoa\Console\Console {}
}
namespace Hoa {
class Prototype extends \Hoa\Prototype\Prototype {}
}
namespace Hoa {
class Memory extends \Hoa\Memory\Memory {}
}
namespace Hoa\Fastcgi {
class Exception extends \Hoa\Fastcgi\Exception\Exception {}
}
namespace Hoa\Cache {
class Backend extends \Hoa\Cache\Backend\Backend {}
}
namespace Hoa {
class Cache extends \Hoa\Cache\Cache {}
}
namespace Hoa\Cache {
class Frontend extends \Hoa\Cache\Frontend\Frontend {}
}
namespace Hoa\Core {
class Parameter extends \Hoa\Core\Parameter\Parameter {}
}
namespace Hoa\Core {
class Event extends \Hoa\Core\Event\Event {}
}
namespace Hoa\Core {
class Exception extends \Hoa\Core\Exception\Exception {}
}
namespace Hoa\Core {
class Consistency extends \Hoa\Core\Consistency\Consistency {}
}
namespace Hoa\Core {
class Protocol extends \Hoa\Core\Protocol\Protocol {}
}
namespace Hoa {
class Core extends \Hoa\Core\Core {}
}
namespace Hoa\Core {
class Data extends \Hoa\Core\Data\Data {}
}
namespace Hoa\Http {
class Response extends \Hoa\Http\Response\Response {}
}
namespace Hoa\Http {
class Exception extends \Hoa\Http\Exception\Exception {}
}
namespace Hoa {
class Http extends \Hoa\Http\Http {}
}
namespace Hoa\Database\Layer {
class Pdo extends \Hoa\Database\Layer\Pdo\Pdo {}
}
namespace Hoa\Database {
class Query extends \Hoa\Database\Query\Query {}
}
namespace Hoa {
class Praspel extends \Hoa\Praspel\Praspel {}
}
namespace Hoa\Praspel\Exception {
class Failure extends \Hoa\Praspel\Exception\Failure\Failure {}
}
namespace Hoa\Praspel {
class Exception extends \Hoa\Praspel\Exception\Exception {}
}
namespace Hoa\Praspel\Iterator {
class Coverage extends \Hoa\Praspel\Iterator\Coverage\Coverage {}
}
namespace Hoa\Praspel\Model {
class Variable extends \Hoa\Praspel\Model\Variable\Variable {}
}
namespace Hoa\Praspel {
class AssertionChecker extends \Hoa\Praspel\AssertionChecker\AssertionChecker {}
}
namespace Hoa {
class Session extends \Hoa\Session\Session {}
}
namespace Hoa\Session {
class Exception extends \Hoa\Session\Exception\Exception {}
}
namespace Hoa {
class Graph extends \Hoa\Graph\Graph {}
}
namespace Hoa {
class Locale extends \Hoa\Locale\Locale {}
}
namespace Hoa\Locale {
class Localizer extends \Hoa\Locale\Localizer\Localizer {}
}
namespace Hoa {
class Tree extends \Hoa\Tree\Tree {}
}
namespace Hoa\Math\Combinatorics {
class Combination extends \Hoa\Math\Combinatorics\Combination\Combination {}
}
namespace Hoa\Math {
class Exception extends \Hoa\Math\Exception\Exception {}
}
namespace Hoa\Math {
class Sampler extends \Hoa\Math\Sampler\Sampler {}
}
namespace Hoa\Compiler {
class Exception extends \Hoa\Compiler\Exception\Exception {}
}
namespace Hoa\Compiler\Llk {
class Rule extends \Hoa\Compiler\Llk\Rule\Rule {}
}
namespace Hoa\Compiler\Llk {
class Sampler extends \Hoa\Compiler\Llk\Sampler\Sampler {}
}
namespace Hoa\Compiler {
class Llk extends \Hoa\Compiler\Llk\Llk {}
}
namespace Hoa {
class Ruler extends \Hoa\Ruler\Ruler {}
}
namespace Hoa\Ruler {
class Exception extends \Hoa\Ruler\Exception\Exception {}
}
namespace Hoa\Ruler\Model {
class Bag extends \Hoa\Ruler\Model\Bag\Bag {}
}
namespace Hoa\Ruler {
class Model extends \Hoa\Ruler\Model\Model {}
}
namespace Hoa\Xyl {
class Element extends \Hoa\Xyl\Element\Element {}
}
namespace Hoa\Xyl\Interpreter {
class Html extends \Hoa\Xyl\Interpreter\Html\Html {}
}
namespace Hoa\Xyl {
class Interpreter extends \Hoa\Xyl\Interpreter\Interpreter {}
}
namespace Hoa {
class Xyl extends \Hoa\Xyl\Xyl {}
}
namespace Hoa\Realdom {
class Exception extends \Hoa\Realdom\Exception\Exception {}
}
namespace Hoa {
class Realdom extends \Hoa\Realdom\Realdom {}
}
namespace Hoa {
class Promise extends \Hoa\Promise\Promise {}
}
namespace Hoa {
class Bench extends \Hoa\Bench\Bench {}
}
namespace Hoa {
class Log extends \Hoa\Log\Log {}
}
namespace Hoa\Log {
class Backtrace extends \Hoa\Log\Backtrace\Backtrace {}
}
namespace Hoa {
class String extends \Hoa\String\String {}
}
namespace Hoa\Xml {
class Element extends \Hoa\Xml\Element\Element {}
}
namespace Hoa\Xml {
class Exception extends \Hoa\Xml\Exception\Exception {}
}
namespace Hoa {
class Xml extends \Hoa\Xml\Xml {}
}
namespace Hoa {
class Iterator extends \Hoa\Iterator\Iterator {}
}
namespace Hoa\Iterator {
class Recursive extends \Hoa\Iterator\Recursive\Recursive {}
}
namespace Hoa {
class   extends \Hoa\ \  {}
}
namespace Hoa {
class Dispatcher extends \Hoa\Dispatcher\Dispatcher {}
}
namespace Hoa\Mail {
class Exception extends \Hoa\Mail\Exception\Exception {}
}
namespace Hoa\Mail {
class Content extends \Hoa\Mail\Content\Content {}
}
namespace Hoa {
class Registry extends \Hoa\Registry\Registry {}
}
namespace Hoa {
class Model extends \Hoa\Model\Model {}
}
namespace Hoa\Router {
class Exception extends \Hoa\Router\Exception\Exception {}
}
namespace Hoa {
class Router extends \Hoa\Router\Router {}
}
namespace Hoa\Stream {
class Filter extends \Hoa\Stream\Filter\Filter {}
}
namespace Hoa {
class Stream extends \Hoa\Stream\Stream {}
}
namespace Hoa\Stream {
class Wrapper extends \Hoa\Stream\Wrapper\Wrapper {}
}
namespace Hoa\Stream\Wrapper {
class IWrapper extends \Hoa\Stream\Wrapper\IWrapper\IWrapper {}
}
namespace Hoa\Socket {
class Connection extends \Hoa\Socket\Connection\Connection {}
}
namespace Hoa {
class Socket extends \Hoa\Socket\Socket {}
}
namespace Hoa {
class Translate extends \Hoa\Translate\Translate {}
}
namespace Hoa {
class File extends \Hoa\File\File {}
}
namespace Hoa\File {
class Exception extends \Hoa\File\Exception\Exception {}
}
namespace Hoa\File {
class Link extends \Hoa\File\Link\Link {}
}
namespace Hoa\File {
class Temporary extends \Hoa\File\Temporary\Temporary {}
}
namespace Hoa {
class Acl extends \Hoa\Acl\Acl {}
}
namespace Hoa\Websocket {
class Exception extends \Hoa\Websocket\Exception\Exception {}
}
namespace Hoa\XmlRpc {
class Exception extends \Hoa\Xmlrpc\Exception\Exception {}
}
namespace Hoa\XmlRpc {
class Message extends \Hoa\Xmlrpc\Message\Message {}
}
namespace Hoa {
class Stringbuffer extends \Hoa\Stringbuffer\Stringbuffer {}
}
namespace Hoa {
class Mime extends \Hoa\Mime\Mime {}
}
namespace Hoa\Mime {
class Exception extends \Hoa\Mime\Exception\Exception {}
}
namespace Hoa {
class Zombie extends \Hoa\Zombie\Zombie {}
}

@Hywan
Copy link
Member

Hywan commented Feb 11, 2015

@camael24 “these modifications” :-).

@Hywan
Copy link
Member

Hywan commented Feb 11, 2015

@camael24 I don't use an IDE but does it fit in the IDE's users' workflow?

@Metalaka
Copy link
Member

I think it can be useful (because I'm very lazy so I need a good auto-completion :).
But why adding support for IDE now when you plan to remove PHPDoc in favor of Praspel ?
(related to: hoaproject/Core#65)

What about adding abstract/interface/trait/final ?

namespace Hoa {
abstract class Dispatcher extends \Hoa\Dispatcher\Dispatcher {}
}
namespace Hoa {
interface Router extends \Hoa\Router\Router {}
}

Could be done with ReflexionClass::is*().

@Hywan
Copy link
Member

Hywan commented Feb 11, 2015

@Metalaka This PR address a different problem than the (hypothetical) removal PHPDoc.

@Hywan
Copy link
Member

Hywan commented Mar 26, 2015

ping?

break;
}

$hoaPath = 'hoa://Library/';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hoa will resolve this in the following order and use the first it found.

  • Data/Library/Hoathis/
  • Data/Library/Hoa/
  • vendor/Hoathis/
  • vendor/Hoa/

So if Hoa find one of the three first directory the script will not work as expected.

Moreover, it cause problems with Windows :/

@Metalaka
Copy link
Member

Metalaka commented Jul 6, 2015

Fix hoaproject/Core#39

I worked on this today: master...Metalaka:alias

  • CS fixed.
  • Will generate more specific aliases (interface/abstract...)
  • "read" loop has been refactored.

@Hywan Should I do a PR on camael24:f/stub_generate or else ?

@Hywan
Copy link
Member

Hywan commented Jul 7, 2015

@Metalaka Yup, make a PR on this PR. Except if @camael24 is too busy to merge your PR.

@camael24: Thoughts?

@thehawk970
Copy link
Author

Make the PR on my PR i merge it as soon as possible :)

@thehawk970
Copy link
Author

I juste rebase my PR on master :) and you can go :)

@Metalaka
Copy link
Member

Metalaka commented Jul 7, 2015

Done.

@Hywan
Copy link
Member

Hywan commented Jul 14, 2015

And now?

@Hywan
Copy link
Member

Hywan commented Jul 20, 2015

Well, sorry but the name is not correct. It's not meaningfull. Any proposal?

@thehawk970
Copy link
Author

What do you think about autocomplete, autocompletion, 'helper_autocomplete, 'ide_autocomplete ? really hard for to to find one word for that :/

@Hywan
Copy link
Member

Hywan commented Jul 21, 2015

What about “unfold classnames”? Or better: “unfold entity names”?

@thehawk970
Copy link
Author

name are too long for the command no ?
hoa devtools:unfoldEntityNames ?

@Hywan
Copy link
Member

Hywan commented Jul 21, 2015

Nop :-p. Maybe “unfold entites” or “resolve entities” can be correct too.

@thehawk970
Copy link
Author

I can't see how do this in the code causes how manage the space ? with _ ? there are conflict with \ no ?

@@ -124,7 +124,7 @@ public function main()

$arguments[] = $path;

$processus = new Console\Processus($phpCsFixer, $arguments);
$processus = new Console\Processus('php '.$phpCsFixer, $arguments);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh?

@Hywan
Copy link
Member

Hywan commented Aug 4, 2015

@camael24 Correct, that's the hoaproject/Core#57 issue. Never mind. Tell me what name you would like to choose and we will see how to format it.

@Hywan
Copy link
Member

Hywan commented Mar 3, 2016

What is the status of this PR?

@Metalaka
Copy link
Member

Metalaka commented Mar 3, 2016

@Hywan @camael24 The feature is waiting for a name.

I vote for resolve entities or resolve flex entities

@thehawk970
Copy link
Author

i am agree with resolve flex entities

@thehawk970
Copy link
Author

ping @Hywan see my previous comment

@Metalaka
Copy link
Member

Metalaka commented Mar 8, 2016

@camael24 can you go ahead and change the name in the code?
Then @Hywan will merge it (and maybe rename the feature if he has a better name ;)

@Hywan
Copy link
Member

Hywan commented Mar 9, 2016

Resolving implies something that is not solved, so a problem to solve. There is no problem here. What about unfold flex entities?

@Hywan
Copy link
Member

Hywan commented Mar 9, 2016

Funny: #6 (comment).

@Metalaka
Copy link
Member

@Hywan good for me too

@Hywan
Copy link
Member

Hywan commented Mar 14, 2016

Waiting on @camael24 so 😃.

@Pierozi
Copy link
Member

Pierozi commented Feb 17, 2017

@camael24 Have you time to finish this PR or did you want some help ?

@Hywan Hywan requested a review from Pierozi February 20, 2017 08:43
Copy link
Member

@Pierozi Pierozi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Change the class name
  • Increase description

}

__halt_compiler();
Resolve class_alias function for the IDE.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A much specific description ? something like
Create stub class of flex entities for enable auto completion on IDE

@jubianchi
Copy link
Member

I don't think the word "unfold" is appropriate here.

Unfolding means, IMHO, that some things are grouped under a common item (folder containing files for example: when we unfold the directory we see files). Here we only have a single item under a single name: flex entity (alias) => actuel class.

I would rather use something like "expand": we go from a short name (flex entity alias) to a full name.

Expanding flex entities is done when we generate stubs of flex entity classes: we could have used "generate stubs" but it wouldn't be explicit about which stubs we generate. "expand flex entities" seems ok to me.

If you need help here, let me know I should have some time in the coming days.

@Hywan
Copy link
Member

Hywan commented Feb 27, 2017

👍 for expand.

@jubianchi please, feel free to take this PR. I don't have time or energy to take it.

@Pierozi
Copy link
Member

Pierozi commented Feb 27, 2017

So let's approve ExpandFlexEntities 👍 ( Choose a name can be very difficult )

@vonglasow
Copy link
Member

👍

@Pierozi
Copy link
Member

Pierozi commented Apr 27, 2017

Closed like it was issued on #43

@Pierozi Pierozi closed this Apr 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

None yet

6 participants